summaryrefslogtreecommitdiff
path: root/src/pluginflagicondelegate.cpp
blob: 6c0bb29eda8cd6f9f8f90bd428b55d755d0632ee (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
#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;
  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();
}