diff options
Diffstat (limited to 'src/genericicondelegate.cpp')
| -rw-r--r-- | src/genericicondelegate.cpp | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/src/genericicondelegate.cpp b/src/genericicondelegate.cpp index 98917c33..1e00f0e9 100644 --- a/src/genericicondelegate.cpp +++ b/src/genericicondelegate.cpp @@ -3,25 +3,37 @@ #include <QList>
#include <QPixmapCache>
-GenericIconDelegate::GenericIconDelegate(QObject* parent, int role, int logicalIndex, int compactSize)
- : IconDelegate(parent), m_Role(role), m_LogicalIndex(logicalIndex), m_CompactSize(compactSize), m_Compact(false) {}
-void GenericIconDelegate::columnResized(int logicalIndex, int, int newSize) {
- if (logicalIndex == m_LogicalIndex) {
- m_Compact = newSize < m_CompactSize;
- }
+GenericIconDelegate::GenericIconDelegate(QObject *parent, int role, int logicalIndex, int compactSize)
+ : IconDelegate(parent)
+ , m_Role(role)
+ , m_LogicalIndex(logicalIndex)
+ , m_CompactSize(compactSize)
+ , m_Compact(false)
+{
+}
+
+void GenericIconDelegate::columnResized(int logicalIndex, int, int newSize)
+{
+ if (logicalIndex == m_LogicalIndex) {
+ m_Compact = newSize < m_CompactSize;
+ }
}
-QList<QString> GenericIconDelegate::getIcons(const QModelIndex& index) const {
- QList<QString> result;
- if (index.isValid()) {
- for (const QVariant& var : index.data(m_Role).toList()) {
- if (!m_Compact || !var.toString().isEmpty()) {
- result.append(var.toString());
- }
- }
+QList<QString> GenericIconDelegate::getIcons(const QModelIndex &index) const
+{
+ QList<QString> result;
+ if (index.isValid()) {
+ for (const QVariant &var : index.data(m_Role).toList()) {
+ if (!m_Compact || !var.toString().isEmpty()) {
+ result.append(var.toString());
+ }
}
- return result;
+ }
+ return result;
}
-size_t GenericIconDelegate::getNumIcons(const QModelIndex& index) const { return index.data(m_Role).toList().count(); }
+size_t GenericIconDelegate::getNumIcons(const QModelIndex &index) const
+{
+ return index.data(m_Role).toList().count();
+}
|
