X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d3839617193e92463806580699caa595c892b8a6..3bf471e0:/src/kitemviews/private/kitemlistheaderwidget.cpp diff --git a/src/kitemviews/private/kitemlistheaderwidget.cpp b/src/kitemviews/private/kitemlistheaderwidget.cpp index 8b39c25fe..329e1da56 100644 --- a/src/kitemviews/private/kitemlistheaderwidget.cpp +++ b/src/kitemviews/private/kitemlistheaderwidget.cpp @@ -417,9 +417,17 @@ void KItemListHeaderWidget::paintRole(QPainter* painter, int orderIndex, QWidget* widget) const { + const auto direction = widget ? widget->layoutDirection() : qApp->layoutDirection(); + // 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 = direction; + option.textAlignment = + direction == Qt::LeftToRight + ? Qt::AlignLeft + : Qt::AlignRight; + option.section = orderIndex; option.state = QStyle::State_None | QStyle::State_Raised | QStyle::State_Horizontal; if (isEnabled()) {