mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 11:30:49 +02:00
* Setup (proxy-)model and load dynamic playlist in DynamicQmlWidget.
This commit is contained in:
@@ -14,18 +14,24 @@ namespace Tomahawk
|
|||||||
|
|
||||||
DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent )
|
DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent )
|
||||||
: QDeclarativeView( 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_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
|
// TODO: fill m_model with the station stuff
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DynamicQmlWidget::~DynamicQmlWidget()
|
DynamicQmlWidget::~DynamicQmlWidget()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -53,6 +53,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
DynamicModel* m_model;
|
DynamicModel* m_model;
|
||||||
PlayableProxyModel* m_proxyModel;
|
PlayableProxyModel* m_proxyModel;
|
||||||
|
|
||||||
|
dynplaylist_ptr m_playlist;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user