I'm creating a Qt widget application.
In Qt Designer, my QProgressBar looks like this:
I set different colors for background and chunk, but when I run my application, background-color doesn't show properly:
I set the following stylesheet:
#progressBar {
color: rgb(180,180,180);
background-color: rgb(100,200,100);
text-align: center;
font-size: 24px;
}
#progressBar::chunk {
background-color: rgb(10,150,0);
}
I'm using:
- Qt version: 6.3.1
- OS: Windows
How can I fix it?


background-colordoes not seem to work withQProgressBaron Windows usingWindowsstyle, it appears to only affect its text background if not aligned:One possible workaround is to set the
QProgressBarstyle toFusion: