diff --git a/src/lib/other/iconchooser.cpp b/src/lib/other/iconchooser.cpp index 40fc8a758..38c6f78ab 100644 --- a/src/lib/other/iconchooser.cpp +++ b/src/lib/other/iconchooser.cpp @@ -17,6 +17,8 @@ * ============================================================ */ #include "iconchooser.h" #include "ui_iconchooser.h" +#include "mainapplication.h" +#include "proxystyle.h" #include "qztools.h" #include @@ -115,8 +117,12 @@ void IconChooserDelegate::paint(QPainter* painter, const QStyleOptionViewItem &o const QStyle* style = w ? w->style() : QApplication::style(); // Draw background - // Use PanelItemViewRow, because of Qt5's Fusion style incorrectly renders PanelItemViewItem - style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, w); + if (mApp->proxyStyle()->name() == QLatin1String("fusion")) { + style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, w); + } + else { + style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w); + } // Draw icon QIcon icon = index.data(Qt::DecorationRole).value(); diff --git a/src/lib/tools/listitemdelegate.cpp b/src/lib/tools/listitemdelegate.cpp index 6cf67ccb0..3893af3a4 100644 --- a/src/lib/tools/listitemdelegate.cpp +++ b/src/lib/tools/listitemdelegate.cpp @@ -16,6 +16,8 @@ * along with this program. If not, see . * ============================================================ */ #include "listitemdelegate.h" +#include "mainapplication.h" +#include "proxystyle.h" #include #include @@ -65,7 +67,12 @@ void ListItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem &opti // Draw background // Use PanelItemViewRow, because of Qt5's Fusion style incorrectly renders PanelItemViewItem - style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter); + if (mApp->proxyStyle()->name() == QLatin1String("fusion")) { + style->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, w); + } + else { + style->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, painter, w); + } // Draw icon QRect iconRect(opt.rect.left() + (opt.rect.width() - m_iconSize) / 2, topPosition, m_iconSize, m_iconSize);