summaryrefslogtreecommitdiff
path: root/src/pluginflagicondelegate.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-04-05 15:36:42 +0200
committerTannin <devnull@localhost>2014-04-05 15:36:42 +0200
commitcabed9b268c9f095d5e3b98a6797b0bcdcd38b1f (patch)
tree454b03b0c5664e90fe586e7b39603e34a526d35b /src/pluginflagicondelegate.cpp
parent98e5e57a845541acddf519a81957261f58008cb9 (diff)
parentc017f4a0d50b67a44e276bd5ae8929ed3990c62c (diff)
Merge with branch1.1
Diffstat (limited to 'src/pluginflagicondelegate.cpp')
-rw-r--r--src/pluginflagicondelegate.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pluginflagicondelegate.cpp b/src/pluginflagicondelegate.cpp
new file mode 100644
index 00000000..761555d7
--- /dev/null
+++ b/src/pluginflagicondelegate.cpp
@@ -0,0 +1,26 @@
+#include "pluginflagicondelegate.h"
+#include "pluginlist.h"
+#include <QList>
+
+
+PluginFlagIconDelegate::PluginFlagIconDelegate(QObject *parent)
+ : IconDelegate(parent)
+{
+}
+
+QList<QIcon> PluginFlagIconDelegate::getIcons(const QModelIndex &index) const
+{
+ QList<QIcon> result;
+ if (index.isValid()) {
+ foreach (const QVariant &var, index.data(Qt::UserRole + 1).toList()) {
+ result.append(var.value<QIcon>());
+ }
+ }
+ return result;
+}
+
+size_t PluginFlagIconDelegate::getNumIcons(const QModelIndex &index) const
+{
+ return index.data(Qt::UserRole + 1).toList().count();
+}
+