#include "genericicondelegate.h" #include "pluginlist.h" #include #include GenericIconDelegate::GenericIconDelegate(QTreeView* parent, int role, int logicalIndex, int compactSize) : IconDelegate(parent, logicalIndex, compactSize), m_Role(role) {} QList GenericIconDelegate::getIcons(const QModelIndex& index) const { QList result; if (index.isValid()) { for (const QVariant& var : index.data(m_Role).toList()) { if (!compact() || !var.toString().isEmpty()) { result.append(var.toString()); } } } return result; } size_t GenericIconDelegate::getNumIcons(const QModelIndex& index) const { return index.data(m_Role).toList().count(); }