From 3921cd26a481ff4c69fbf8c71050d778b35d80a3 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 3 May 2009 12:20:28 -0400 Subject: Add data roles for other columns --- sigmodr/tree/TreeModel.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sigmodr/tree/TreeModel.cpp') 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(); } -- cgit