1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 19:14:06 +02:00

* Setup (proxy-)model and load dynamic playlist in DynamicQmlWidget.

This commit is contained in:
Christian Muehlhaeuser
2012-07-03 17:05:42 +02:00
parent 2fb8b57e25
commit 92d7757e47
2 changed files with 11 additions and 3 deletions

View File

@@ -14,18 +14,24 @@ namespace Tomahawk
DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent )
: QDeclarativeView( parent )
, m_playlist( playlist )
{
setResizeMode(QDeclarativeView::SizeRootObjectToView);
setResizeMode( QDeclarativeView::SizeRootObjectToView );
setSource( QUrl( "qrc" RESPATH "qml/ArtistInfoScene.qml" ) );
m_model = new DynamicModel( this );
m_proxyModel = new PlayableProxyModel( this );
m_proxyModel->setSourcePlayableModel( m_model );
rootContext()->setContextProperty("dynamicModel", m_model);
rootContext()->setContextProperty( "dynamicModel", m_proxyModel );
setSource(QUrl("qrc" RESPATH "qml/StationScene.qml"));
m_model->loadPlaylist( m_playlist );
setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) );
// TODO: fill m_model with the station stuff
}
DynamicQmlWidget::~DynamicQmlWidget()
{
}

View File

@@ -53,6 +53,8 @@ public:
private:
DynamicModel* m_model;
PlayableProxyModel* m_proxyModel;
dynplaylist_ptr m_playlist;
};
}