QProgressBar step sizes too large.
goocreations last edited by
I'm using Qt 5 (alpha). I want a QProgressBar that runs "smoothly". Since ranges from 0 - 100 are not smooth enough, I've set the range from 0 to 10000. I continuously increment the value for the progress bar by one, however the progress bar is only updated every 1% (not every step). With a [0, 100] bar this would be exactly 1 step. With a [0, 10000] these are 100 steps.
What this means is if my current value is at 5000, if I set any value from 5000 to 5099, nothing happens (the progress bar does not move). Only when 5100 is hit, the bar updates with an entire chunk of 1% of the length. Hence it doesn’t matter which range you set, the bar will only move if the value changes by at least 1% of the maximum value.
Do I understand the QProgressBar doc's correctly and should it behave like this, or is this a bug?
I used progress bar on Qt 4.8 and that was the normal behaviour, I also tried to set up larger ranges, but it only increases by 1% regardless of the range. It may look smoother if you set up the progress bar with a smaller horizontal size.
sandy.pareek last edited by
I am new to qt, but same problem was encountered by me when i was doing my ty project.
It was in MSVB8, So, what i did was associated a timer there and reduced the clock pulse of the timer (which is 1 second or 1000 mili seconds) to 100 MS. and rest of the procedure was same (increasing the value from 1 to 1000 instead of 1 to 100). As I am new to qt and learning, I am afraid is there any timer available in qt.
bq. As I am new to qt and learning, I am afraid is there any timer available in qt
There is a high resolution timer with millisecond interval. see "QTimer class reference":http://doc.qt.nokia.com/4.7/qtimer.html.
bq. There is a high resolution timer with millisecond interval.
Keep in mind that even though you can request a timeout level down to millisecond resolution with QTimer, there is no guarantee that the timer will be called with that resolution. The actual temporal resolution of the QTimer is limited by the underlying operating system and there are no guarantees of real-time operation.