diff options
| author | Tannin <devnull@localhost> | 2015-03-27 16:36:55 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-03-27 16:36:55 +0100 |
| commit | 4d4a7713fb936f632dc655abd0196adada0784de (patch) | |
| tree | c0140d82eeccd72c000040929e0fdae54bceb279 /src/icondelegate.cpp | |
| parent | 41616965270180f42ae4c835042fc6159bf68841 (diff) | |
bugfix: not all icons showed up
Diffstat (limited to 'src/icondelegate.cpp')
| -rw-r--r-- | src/icondelegate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/icondelegate.cpp b/src/icondelegate.cpp index 794ac7f3..ef9011b6 100644 --- a/src/icondelegate.cpp +++ b/src/icondelegate.cpp @@ -45,10 +45,16 @@ void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->translate(option.rect.topLeft());
for (const QString &iconId : icons) {
+ if (iconId.isEmpty()) {
+ continue;
+ }
QPixmap icon;
QString fullIconId = QString("%1_%2").arg(iconId).arg(iconWidth);
if (!QPixmapCache::find(fullIconId, &icon)) {
icon = QIcon(iconId).pixmap(iconWidth, iconWidth);
+ if (icon.isNull()) {
+ qWarning("failed to load icon %s", qPrintable(iconId));
+ }
QPixmapCache::insert(fullIconId, icon);
}
painter->drawPixmap(x, 2, iconWidth, iconWidth, icon);
|
