From c7e25a4bb75417f1615b71940694f5f4479f9043 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 13 Jun 2010 14:52:16 +0200 Subject: Implemented SeriesTreeWidget Implemented a widget for showing series in a tree. Also implemented filtering and sorting for this widget. Some bugfixes and enhancements: -Show dildo as DecorationRole in SeriesWidget -removed Quality from SeriesWidget --- smtreemodel.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'smtreemodel.cpp') diff --git a/smtreemodel.cpp b/smtreemodel.cpp index fe5482c..c762802 100644 --- a/smtreemodel.cpp +++ b/smtreemodel.cpp @@ -5,6 +5,8 @@ 2 of the License, or (at your option) any later version. */ +#include + #include "smtreemodel.h" #include "smtreeitem.h" @@ -62,7 +64,7 @@ Qt::ItemFlags SmTreeModel::flags(const QModelIndex &index) const{ QVariant SmTreeModel::headerData(int section, Qt::Orientation orientation, int role) const{ if((orientation == Qt::Horizontal) && (role == Qt::DisplayRole)){ - return mRootItem->data(section); + return mHeaders.at(section); } return QVariant(); } @@ -87,6 +89,11 @@ QVariant SmTreeModel::data(const QModelIndex &index, int role) const{ if(role == Qt::EditRole){ return item->data(index.column()); } + if(role == Qt::DecorationRole){ + if(index.column() == 0){ + return QIcon(":/dildo.png"); + } + } return QVariant(); } -- cgit v1.2.3-70-g09d2