QProgressBar Chunk
-
wrote on 12 Dec 2010, 09:54 last edited by
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.
-
wrote on 12 Dec 2010, 10:00 last edited by
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 ... -
wrote on 12 Dec 2010, 10:08 last edited by
Wow, thats cool. Is there anyway to change the size of the chunk or the speed of movement?
-
wrote on 12 Dec 2010, 10:23 last edited by
Only in the style, I think.
-
wrote on 12 Dec 2010, 10:26 last edited by
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...
-
wrote on 12 Dec 2010, 10:33 last edited by
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 -
wrote on 12 Dec 2010, 10:37 last edited by
Thank you very much for your help
-
wrote on 12 Dec 2010, 10:37 last edited by
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?
-
wrote on 12 Dec 2010, 10:46 last edited by
Yip, exactly that bar is what I need (2nd one)
-
wrote on 12 Dec 2010, 14:19 last edited by
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
9/10