diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index f3647f656a1..5a7615b388c 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1741,7 +1741,8 @@ void QTreeView::drawRow(QPainter *painter, const QStyleOptionViewItem &option, } // draw background for the branch (selection + alternate row) opt.rect = branches; - style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, this); + if (style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, &opt, this)) + style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, this); // draw background of the item (only alternate row). rest of the background // is provided by the delegate