diff options
Diffstat (limited to 'src/genericicondelegate.cpp')
| -rw-r--r-- | src/genericicondelegate.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/genericicondelegate.cpp b/src/genericicondelegate.cpp index bb039b05..1ee980ab 100644 --- a/src/genericicondelegate.cpp +++ b/src/genericicondelegate.cpp @@ -3,18 +3,16 @@ #include <QList> #include <QPixmapCache> +GenericIconDelegate::GenericIconDelegate(QTreeView* parent, int role, int logicalIndex, + int compactSize) + : IconDelegate(parent, logicalIndex, compactSize), m_Role(role) +{} -GenericIconDelegate::GenericIconDelegate(QTreeView* parent, int role, int logicalIndex, int compactSize) - : IconDelegate(parent, logicalIndex, compactSize) - , m_Role(role) -{ -} - -QList<QString> GenericIconDelegate::getIcons(const QModelIndex &index) const +QList<QString> GenericIconDelegate::getIcons(const QModelIndex& index) const { QList<QString> result; if (index.isValid()) { - for (const QVariant &var : index.data(m_Role).toList()) { + for (const QVariant& var : index.data(m_Role).toList()) { if (!compact() || !var.toString().isEmpty()) { result.append(var.toString()); } @@ -23,7 +21,7 @@ QList<QString> GenericIconDelegate::getIcons(const QModelIndex &index) const return result; } -size_t GenericIconDelegate::getNumIcons(const QModelIndex &index) const +size_t GenericIconDelegate::getNumIcons(const QModelIndex& index) const { return index.data(m_Role).toList().count(); } |
