diff options
| author | Tannin <devnull@localhost> | 2015-02-25 17:48:37 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-02-25 17:48:37 +0100 |
| commit | 671d96383b2668ef773a49ba943328ddf0c98420 (patch) | |
| tree | bf900f0e1d806269e1684f7122999285d11f5d49 /src/genericicondelegate.cpp | |
| parent | bdfd41a8621cec48bcd8da61f361269a641cdbb1 (diff) | |
icon delegates now use a pixmap cache to improve rendering performance
Diffstat (limited to 'src/genericicondelegate.cpp')
| -rw-r--r-- | src/genericicondelegate.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/genericicondelegate.cpp b/src/genericicondelegate.cpp index c3471735..3711b428 100644 --- a/src/genericicondelegate.cpp +++ b/src/genericicondelegate.cpp @@ -1,6 +1,7 @@ #include "genericicondelegate.h"
#include "pluginlist.h"
#include <QList>
+#include <QPixmapCache>
GenericIconDelegate::GenericIconDelegate(QObject *parent, int role, int logicalIndex, int compactSize)
@@ -19,14 +20,13 @@ void GenericIconDelegate::columnResized(int logicalIndex, int, int newSize) }
}
-QList<QIcon> GenericIconDelegate::getIcons(const QModelIndex &index) const
+QList<QString> GenericIconDelegate::getIcons(const QModelIndex &index) const
{
- QList<QIcon> result;
+ QList<QString> result;
if (index.isValid()) {
foreach (const QVariant &var, index.data(m_Role).toList()) {
- QIcon icon = var.value<QIcon>();
- if (!m_Compact || !icon.isNull()) {
- result.append(icon);
+ if (!m_Compact || !var.toString().isEmpty()) {
+ result.append(var.toString());
}
}
}
|
