From 8a8f26d39a42bf3f7d66c528f19c2d1718ecf8f7 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 1 Mar 2024 13:22:52 +0100 Subject: [PATCH] Axivion: Avoid sort indicator overlapping column text If the column is too narrow we may overlap the text of the column header. Explicitly clear the area before painting the icon. Change-Id: If73c1e2cc66c21dd9ffa41710873faa654bf235e Reviewed-by: hjk --- src/plugins/axivion/issueheaderview.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/axivion/issueheaderview.cpp b/src/plugins/axivion/issueheaderview.cpp index a9dfd38b8df..3635568a5a8 100644 --- a/src/plugins/axivion/issueheaderview.cpp +++ b/src/plugins/axivion/issueheaderview.cpp @@ -144,7 +144,15 @@ void IssueHeaderView::paintSection(QPainter *painter, const QRect &rect, int log const int margin = style()->pixelMetric(QStyle::PM_HeaderGripMargin, nullptr, this); const QIcon icon = iconForSorted(logicalIndex == m_currentSortIndex ? m_currentSortOrder : SortOrder::None); const int offset = qMax((rect.height() - ICON_SIZE), 0) / 2; - const QRect iconRect(rect.left() + rect.width() - ICON_SIZE - margin, offset, ICON_SIZE, ICON_SIZE); + const int left = rect.left() + rect.width() - ICON_SIZE - margin; + const QRect iconRect(left, offset, ICON_SIZE, ICON_SIZE); + const QRect clearRect(left, 0, ICON_SIZE + margin, rect.height()); + painter->save(); + QStyleOptionHeader opt; + initStyleOption(&opt); + opt.rect = clearRect; + style()->drawControl(QStyle::CE_Header, &opt, painter, this); + painter->restore(); icon.paint(painter, iconRect); }