summaryrefslogtreecommitdiff
path: root/src/pluginflagicondelegate.cpp
blob: 761555d78e7bd6cc52f1cec3885328dae5ea1487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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();
}