From 952dc2651494889073f8b28ff015d03bc5125cee Mon Sep 17 00:00:00 2001 From: jagannatharjun Date: Sat, 4 Jul 2020 15:49:21 +0530 Subject: [PATCH] Use delegate provided rect for textRect in LogItemDelegate Previously we get textRect from QStyle but on some OS this returns invalid rect --- src/gui/log/loglistview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/log/loglistview.cpp b/src/gui/log/loglistview.cpp index 660bb49f1..9ea6cf693 100644 --- a/src/gui/log/loglistview.cpp +++ b/src/gui/log/loglistview.cpp @@ -71,8 +71,7 @@ namespace QStyledItemDelegate::paint(painter, option, index); // paints background, focus rect and selection rect const QStyle *style = option.widget ? option.widget->style() : QApplication::style(); - const QRect textRect = style->subElementRect(QStyle::SE_ItemViewItemText, &option, option.widget) - .adjusted(1, 0, 0, 0); // shift 1 to avoid text being too close to focus rect + const QRect textRect = option.rect.adjusted(1, 0, 0, 0); // shift 1 to avoid text being too close to focus rect // for unknown reasons (fixme) painter won't accept some font properties // until they are set explicitly, and we have to manually set some font properties