1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 14:46:33 +02:00

* Make DynamicQmlWidget a proper ViewPage.

This commit is contained in:
Christian Muehlhaeuser
2012-07-03 16:37:47 +02:00
parent c05bae9e8c
commit c295514598
3 changed files with 59 additions and 5 deletions

View File

@@ -158,7 +158,7 @@ TreeView::setTreeModel( TreeModel* model )
}
emit modelChanged();
/* setColumnHidden( PlayableModel::Score, true ); // Hide score column per default
setColumnHidden( PlayableModel::Origin, true ); // Hide origin column per default
setColumnHidden( PlayableModel::Composer, true ); //Hide composer column per default

View File

@@ -1,4 +1,7 @@
#include "DynamicQmlWidget.h"
#include "playlist/dynamic/DynamicModel.h"
#include "playlist/PlayableProxyModel.h"
#include "utils/TomahawkUtilsGui.h"
#include <QUrl>
@@ -6,19 +9,52 @@
namespace Tomahawk
{
DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent)
DynamicQmlWidget::DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent )
: QDeclarativeView( parent )
{
setResizeMode(QDeclarativeView::SizeRootObjectToView);
setSource(QUrl("qrc" RESPATH "qml/ArtistInfoScene.qml"));
}
DynamicQmlWidget::~DynamicQmlWidget()
{
}
Tomahawk::playlistinterface_ptr
DynamicQmlWidget::playlistInterface() const
{
return m_proxyModel->playlistInterface();
}
QString
DynamicQmlWidget::title() const
{
return m_model->title();
}
QString
DynamicQmlWidget::description() const
{
return m_model->description();
}
QPixmap
DynamicQmlWidget::pixmap() const
{
return QPixmap( RESPATH "images/station.png" );
}
bool
DynamicQmlWidget::jumpToCurrentTrack()
{
return false;
}
}

View File

@@ -24,17 +24,35 @@
#include <QDeclarativeView>
class PlayableProxyModel;
namespace Tomahawk
{
class DynamicModel;
class DynamicQmlWidget : public QDeclarativeView, public Tomahawk::ViewPage
{
Q_OBJECT
public:
explicit DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent = 0);
explicit DynamicQmlWidget( const dynplaylist_ptr& playlist, QWidget* parent = 0 );
virtual ~DynamicQmlWidget();
virtual QWidget* widget() { return this; }
virtual Tomahawk::playlistinterface_ptr playlistInterface() const;
virtual QString title() const;
virtual QString description() const;
virtual QPixmap pixmap() const;
virtual bool showModes() const { return true; }
virtual bool showFilter() const { return true; }
virtual bool jumpToCurrentTrack();
private:
DynamicModel* m_model;
PlayableProxyModel* m_proxyModel;
};
}