Enable QStyle::State_Horizontal when initializing QStyleOptionProgressBar
Since by default QStyleOptionProgressBar is initialized with initialize QStyle::State_Horizontal, the example shouldn't overwrite the state, and instead OR other states into it. Otherwise, the progressbar will be laid out vertically. Pick-to: 6.2 6.3 Fixes: QTBUG-100067 Change-Id: Ibebda48a297af4a621719673033f8199b8bc7984 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
b292928e35
commit
60f21e96ae
@ -90,7 +90,7 @@ public:
|
||||
// Set up a QStyleOptionProgressBar to precisely mimic the
|
||||
// environment of a progress bar.
|
||||
QStyleOptionProgressBar progressBarOption;
|
||||
progressBarOption.state = QStyle::State_Enabled;
|
||||
progressBarOption.state |= QStyle::State_Enabled;
|
||||
progressBarOption.direction = QApplication::layoutDirection();
|
||||
progressBarOption.rect = option.rect;
|
||||
progressBarOption.fontMetrics = QFontMetrics(QApplication::font());
|
||||
|
Loading…
x
Reference in New Issue
Block a user