Commit e8dc49e4 authored by Jan Blackquill's avatar Jan Blackquill 🌈 Committed by Jan Blackquill
Browse files

KItemListHeaderWidget: don't crash if widget == nullptr

BUG: 449238
parent 505bf52f
Pipeline #144764 passed with stage
in 3 minutes and 55 seconds
......@@ -417,12 +417,14 @@ 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 = widget->layoutDirection();
option.direction = direction;
option.textAlignment =
widget->layoutDirection() == Qt::LeftToRight
direction == Qt::LeftToRight
? Qt::AlignLeft
: Qt::AlignRight;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment