From 65846125d7f4dd90acd69abf73161607ba76cc8b Mon Sep 17 00:00:00 2001 From: Jan Blackquill Date: Fri, 21 Jan 2022 18:42:20 -0500 Subject: Make group headers mirror rtl --- src/kitemviews/private/kitemlistheaderwidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/kitemviews/private/kitemlistheaderwidget.cpp') diff --git a/src/kitemviews/private/kitemlistheaderwidget.cpp b/src/kitemviews/private/kitemlistheaderwidget.cpp index 8b39c25fe..5fb929e52 100644 --- a/src/kitemviews/private/kitemlistheaderwidget.cpp +++ b/src/kitemviews/private/kitemlistheaderwidget.cpp @@ -420,6 +420,12 @@ void KItemListHeaderWidget::paintRole(QPainter* painter, // The following code is based on the code from QHeaderView::paintSection(). // SPDX-FileCopyrightText: 2011 Nokia Corporation and/or its subsidiary(-ies). QStyleOptionHeader option; + option.direction = widget->layoutDirection(); + option.textAlignment = + widget->layoutDirection() == Qt::LeftToRight + ? Qt::AlignLeft + : Qt::AlignRight; + option.section = orderIndex; option.state = QStyle::State_None | QStyle::State_Raised | QStyle::State_Horizontal; if (isEnabled()) { -- cgit v1.3