QProgressBar Chunk
-
I've tried google for this, but I'm not sure what to search for.
I'm looking for a way to change a QProgressBar so that only a chunk with a fixed size is moving. That is, the progress bar is not filling up from one side to another, but that only a chunk/part is moving from one side to another. (If the progress bar is 100px, I only want a 10px chunk moving from left to right).
I think I saw something like this in KDE.
-
Hi,
look at the class documentation: "QProgressBar":http://doc.qt.nokia.com/4.7/qprogressbar.html
It's a bit tricky, but set minimum = 0, maximum=0, value=-1.On windows, that works ... -
Wow, thats cool. Is there anyway to change the size of the chunk or the speed of movement?
-
Only in the style, I think.
-
Could be that it only works on windows with windows style. And I think, if you use style sheets, it does not work anymore, especially in 4.5, there we triesd that with a style sheet. Whether that is fixed in 4.7 I don't know...
-
I tried it with differen styles (modife, CDE, plastique, cleanlooks, windows, windows XP, windows vista) and it worked in all.
And I tried to style it, it is also possible:@
QProgressBar::chunk {
background-color: #05B8CC;
width: 20px;
}
@
used as style sheet. See "Styling the progress bar":http://doc.qt.nokia.com/4.6/stylesheet-examples.html#customizing-qprogressbar -
Thank you very much for your help
-
Looks like there is not a way to make the QProgressBar in maquee style (I think it what goocreations mean).
!http://www.devexpress.com/Subscriptions/DXperience/WhatsNew2010v1/i/wpf-progress-bar.png(Marquee)!
Is it the second bar you'd like to use?
-
Yip, exactly that bar is what I need (2nd one)
-
It is a marquee bar.
From Qt Documentarion:
bq. If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded.
Tested and working