From 83444d8851f7f09bff09a5c487d0cbcc9532ac2b Mon Sep 17 00:00:00 2001 From: David Rosca Date: Sun, 25 Dec 2016 20:35:57 +0100 Subject: [PATCH] IconChooser: Fix drawing selected item with fusion style --- src/lib/other/iconchooser.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib/other/iconchooser.cpp b/src/lib/other/iconchooser.cpp index 0dae18702..71b9384d2 100644 --- a/src/lib/other/iconchooser.cpp +++ b/src/lib/other/iconchooser.cpp @@ -117,15 +117,11 @@ void IconChooserDelegate::paint(QPainter* painter, const QStyleOptionViewItem &o const QStyle* style = w ? w->style() : QApplication::style(); // Draw background - if (mApp->styleName() == QLatin1String("fusion")) { - style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, w); - } - else { - style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w); - } + opt.showDecorationSelected = true; + style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w); // Draw icon - QIcon icon = index.data(Qt::DecorationRole).value(); + const QIcon icon = index.data(Qt::DecorationRole).value(); icon.paint(painter, opt.rect); }