diff options
author | Zhang Hao <zhanghao@uniontech.com> | 2022-01-20 09:32:24 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-21 05:41:35 +0000 |
commit | a7f8a9291f8ccb4f3d934ea676d8ed59bf36408d (patch) | |
tree | e7f362da5b2c1ee37d452158a672e8e980309ba1 /examples/network | |
parent | d01bd60d43a649008e31e12a2ec42a975e3896b1 (diff) |
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.
Fixes: QTBUG-100067
Change-Id: Ibebda48a297af4a621719673033f8199b8bc7984
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 60f21e96aeeda1e1b96b1abd91630a85ea5c1820)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples/network')
-rw-r--r-- | examples/network/torrent/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp index 10a54e7962..39fca70dab 100644 --- a/examples/network/torrent/mainwindow.cpp +++ b/examples/network/torrent/mainwindow.cpp @@ -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()); |