diff options
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r-- | smtreemodel.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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 <QIcon> + #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(); } |