Change color of QProgressBar.
-
Hi,
I have made a progress bar with timer,
And used the following to change the color of progressbarQProgressBar *m_pProgressBar;
m_pProgressBar->setStyleSheet("QProgressBar::chunk {background: rgb(0, 0, 255, 60%);}");- This gives blue progress bar.
Is there a better way to do it ?
-
@Aditya1309 What is wrong with this way?
-
FYI, I also did not understood the concept of QPalette from QT documentation.
-
@Aditya1309 said in Change color of QProgressBar.:
QPalette and and setting the progressbar.
i think there is no cross platform way to change the color of a progressbar via QPalette, only via stylesheets
-
@raven-worx said in Change color of QProgressBar.:
s no cross platform way to change the color of a progressbar via QPalette, only via stylesheets
Thanks, I will check with setStyleSheet only.