From c23f8542b2b53602efe7d30760b9917f858588f0 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 22 Mar 2021 19:53:22 +0300 Subject: [PATCH] Correctly draw progress bar in Qt 6 --- src/gui/progressbarpainter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/progressbarpainter.cpp b/src/gui/progressbarpainter.cpp index 30de4b327..1a85b8a8e 100644 --- a/src/gui/progressbarpainter.cpp +++ b/src/gui/progressbarpainter.cpp @@ -58,7 +58,8 @@ void ProgressBarPainter::paint(QPainter *painter, const QStyleOptionViewItem &op styleOption.textVisible = true; // QStyleOption fields styleOption.rect = option.rect; - styleOption.state = option.state; + // Qt 6 requires QStyle::State_Horizontal to be set for correctly drawing horizontal progress bar + styleOption.state = option.state | QStyle::State_Horizontal; const bool isEnabled = option.state.testFlag(QStyle::State_Enabled); styleOption.palette.setCurrentColorGroup(isEnabled ? QPalette::Active : QPalette::Disabled);