Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProgressBar step sizes too large.
QtWS25 Last Chance

QProgressBar step sizes too large.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 5 Posters 4.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    goocreations
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • U Offline
      U Offline
      ulesQt
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sandy.pareek
        wrote on last edited by
        #3

        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.
        Regards
        Sandy

        "my code, my life"

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hesam_GL
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mlong
            wrote on last edited by
            #5

            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.

            Software Engineer
            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved