mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 21:38:51 +03:00
Merge pull request #14583 from glassez/progress
Correctly draw progress bar in Qt 6
This commit is contained in:
commit
7bc5bfa140
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue