diff options
Diffstat (limited to 'src/pluginflagicondelegate.cpp')
| -rw-r--r-- | src/pluginflagicondelegate.cpp | 26 |
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();
+}
+
|
