From bbdb15c53e074181b869571c34300760909afcd3 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 3 Jul 2012 18:04:58 +0200 Subject: [PATCH] a very very basic pathview for covers --- data/qml/StationScene.qml | 28 ++++++++++++++++++- .../dynamic/widgets/DynamicQmlWidget.cpp | 5 +++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/data/qml/StationScene.qml b/data/qml/StationScene.qml index ca11c9141..af295b207 100644 --- a/data/qml/StationScene.qml +++ b/data/qml/StationScene.qml @@ -1,11 +1,37 @@ import QtQuick 1.1 Rectangle { - color: "red" + color: "black" anchors.fill: parent // height: 200 // width: 200 + PathView { + id: view + anchors.fill: parent + highlight: appHighlight + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + focus: true + model: dynamicModel + delegate: Rectangle { + height: 200 + width: 200 + color: "blue" + border.color: "black" + border.width: 2 + } + + path: Path { + startX: 0 + startY: 0 +// PathAttribute { name: "iconScale"; value: 0.5 } + PathQuad { x: 400; y: 150; controlX: 200; controlY: 75 } +// PathAttribute { name: "iconScale"; value: 1.0 } +// PathQuad { x: 390; y: 50; controlX: 350; controlY: 200 } +// PathAttribute { name: "iconScale"; value: 0.5 } + } + } } diff --git a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp index 59d2c840e..ef7380d6b 100644 --- a/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp +++ b/src/libtomahawk/playlist/dynamic/widgets/DynamicQmlWidget.cpp @@ -4,8 +4,10 @@ #include "playlist/PlayableProxyModel.h" #include "utils/TomahawkUtilsGui.h" #include "dynamic/DynamicModel.h" +#include "PlayableItem.h" #include +#include #include #include @@ -23,9 +25,10 @@ DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* pa m_proxyModel = new PlayableProxyModel( this ); m_proxyModel->setSourcePlayableModel( m_model ); - rootContext()->setContextProperty( "dynamicModel", m_proxyModel ); + rootContext()->setContextProperty( "dynamicModel", m_model ); m_model->loadPlaylist( m_playlist ); + m_model->startOnDemand(); setSource( QUrl( "qrc" RESPATH "qml/StationScene.qml" ) ); // TODO: fill m_model with the station stuff