From 707c2a93d0f9a8ffe9a218629fcb195104c2cc9a Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 1 Jun 2012 09:04:21 +0200 Subject: [PATCH] * Let TreeView manage empty-tooltips, too. --- src/libtomahawk/playlist/TreeView.cpp | 8 ++++++++ src/libtomahawk/playlist/TreeView.h | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/playlist/TreeView.cpp b/src/libtomahawk/playlist/TreeView.cpp index 16820325e..31299e766 100644 --- a/src/libtomahawk/playlist/TreeView.cpp +++ b/src/libtomahawk/playlist/TreeView.cpp @@ -168,6 +168,14 @@ TreeView::setTreeModel( TreeModel* model ) } +void +TreeView::setEmptyTip( const QString& tip ) +{ + m_emptyTip = tip; + m_overlay->setText( tip ); +} + + void TreeView::onViewChanged() { diff --git a/src/libtomahawk/playlist/TreeView.h b/src/libtomahawk/playlist/TreeView.h index cee339518..254403c81 100644 --- a/src/libtomahawk/playlist/TreeView.h +++ b/src/libtomahawk/playlist/TreeView.h @@ -57,11 +57,12 @@ public: TreeModel* model() const { return m_model; } TreeProxyModel* proxyModel() const { return m_proxyModel; } OverlayWidget* overlay() const { return m_overlay; } - // PlaylistItemDelegate* delegate() { return m_delegate; } void setModel( QAbstractItemModel* model ); void setTreeModel( TreeModel* model ); + void setEmptyTip( const QString& tip ); + virtual QWidget* widget() { return this; } virtual Tomahawk::playlistinterface_ptr playlistInterface() const { return proxyModel()->playlistInterface(); } @@ -117,6 +118,7 @@ private: QModelIndex m_contextMenuIndex; Tomahawk::ContextMenu* m_contextMenu; + QString m_emptyTip; bool m_showModes; QTimer m_timer; mutable QString m_guid;