Commit cbfa8095 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MediaLibraryView: Map the model before creating the view

parent 5c154646
......@@ -45,10 +45,11 @@ MediaLibraryView::MediaLibraryView(QWidget *parent)
auto layout = new QBoxLayout( QBoxLayout::TopToBottom, this );
layout->addWidget( container );
view->setSource( QUrl( "qrc:/qml/MediaLibraryView" ) );
view->setResizeMode(QQuickView::SizeRootObjectToView);
auto ctx = view->rootContext();
ctx->setContextProperty( "mlModel", Core::instance()->mediaLibrary()->model( MediaLibrary::MediaType::Video ) );
view->setSource( QUrl( "qrc:/qml/MediaLibraryView" ) );
view->setResizeMode(QQuickView::SizeRootObjectToView);
}
MediaLibraryView::~MediaLibraryView()
......
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