Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable progress bar animation in Qt

Is it possible to disable animation of the progress bar in Qt and make it behave like a meter instead?

Below is the default behavior, and I would instead like it to not have the shiny wave go through it periodically. I was hoping to use it to show used resources such as CPU, memory, and disk space.

enter image description here

like image 567
waspinator Avatar asked May 15 '13 03:05

waspinator


2 Answers

css for use in qt designer:

 QProgressBar::chunk {
     background-color: #3add36;
     width: 1px;
 }

 QProgressBar {
     border: 2px solid grey;
     border-radius: 0px;
     text-align: center;
 }

pyqt example:

my_progress_bar = QProgressBar()
my_progress_bar.setStyleSheet(" QProgressBar { border: 2px solid grey; border-radius: 0px; text-align: center; } QProgressBar::chunk {background-color: #3add36; width: 1px;}")

enter image description here

like image 192
waspinator Avatar answered Sep 16 '22 12:09

waspinator


It looks like the progress bar you are using is the Windows Vista look. You should be able to modify the behavior by changing the stylesheet. Try replacing the background, image of the progressbar and/or the chunk.

like image 38
cogsmos Avatar answered Sep 17 '22 12:09

cogsmos