Commit 8c222c11 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

MediaLibraryView: Don't wrap the container

parent bace6d5a
......@@ -504,8 +504,8 @@ MainWindow::setupEffectsList()
void
MainWindow::setupLibrary()
{
m_mediaLibrary = new MediaLibraryView;
m_dockedLibrary = dockWidget( m_mediaLibrary, Qt::TopDockWidgetArea );
m_mediaLibrary = new MediaLibraryView( this );
m_dockedLibrary = dockWidget( m_mediaLibrary->container(), Qt::TopDockWidgetArea );
}
void
......
......@@ -36,15 +36,14 @@
#include <QQmlContext>
#include <QUrl>
MediaLibraryView::MediaLibraryView(QWidget *parent)
: QWidget(parent)
MediaLibraryView::MediaLibraryView( QWidget* parent )
: QObject( parent )
{
setObjectName( QStringLiteral( "medialibrary" ) );
auto view = new QQuickView;
auto container = QWidget::createWindowContainer( view, this );
auto layout = new QBoxLayout( QBoxLayout::TopToBottom, this );
container->setMinimumWidth( 300 );
layout->addWidget( container );
m_container = QWidget::createWindowContainer( view, parent );
m_container->setMinimumSize( 100, 1 );
m_container->setObjectName( objectName() );
auto ctx = view->rootContext();
ctx->setContextProperty( QStringLiteral( "mlModel" ), Core::instance()->mediaLibrary()->model( MediaLibrary::MediaType::Video ) );
......@@ -56,3 +55,9 @@ MediaLibraryView::MediaLibraryView(QWidget *parent)
MediaLibraryView::~MediaLibraryView()
{
}
QWidget*
MediaLibraryView::container()
{
return m_container;
}
......@@ -25,13 +25,18 @@
#include <QWidget>
class MediaLibraryView : public QWidget
class MediaLibraryView : public QObject
{
Q_DISABLE_COPY( MediaLibraryView )
public:
explicit MediaLibraryView( QWidget *parent = 0);
explicit MediaLibraryView( QWidget* parent = 0);
virtual ~MediaLibraryView();
QWidget* container();
private:
QWidget* m_container;
};
#endif // MEDIALIBRARYVIEW_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment