1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Correctly draw progress bar in Qt 6

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-03-22 19:53:22 +03:00
parent 9b31496b22
commit c23f8542b2
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7

View File

@ -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);