diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-03 12:20:28 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-03 12:20:28 -0400 |
| commit | 3921cd26a481ff4c69fbf8c71050d778b35d80a3 (patch) | |
| tree | 7fffa4bd24e8ed952a1b0e0601f015a9edc22f57 | |
| parent | 74a7cca66437258e9f54b163228e553de47f3282 (diff) | |
Add data roles for other columns
| -rw-r--r-- | sigmodr/tree/TreeModel.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sigmodr/tree/TreeModel.cpp b/sigmodr/tree/TreeModel.cpp index 5db31e06..0ec202fc 100644 --- a/sigmodr/tree/TreeModel.cpp +++ b/sigmodr/tree/TreeModel.cpp @@ -44,6 +44,26 @@ QVariant TreeModel::data(const QModelIndex& index, const int role) const if (!index.column()) return item->text(); } + else if (role == Qt::DecorationRole) + { + switch (index.column()) + { + case 1: + if (item->canEdit()) + return KIcon("document-edit"); + break; + case 2: + if (item->canRemove()) + return KIcon("list-remove"); + break; + case 3: + if (item->canAddTo()) + return KIcon("list-add"); + break; + default: + break; + } + } return QVariant(); } |
