Results 1 to 5 of 5

Thread: Maximum value of ProgressBar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Maximum value of ProgressBar

    If you have such big loops then setting value for the progress bar inside the most inner loop is not a good idea. Each time you set a new value and want it to be reflected in your UI, you need to force Qt to process its events. If you do that inside the most-inner loop, events are going to be processed a lot. Each time they are processed, the application is not doing the tasked you wanted it to but instead spins the event loop. This makes your task execute much longer (for some tasks it might take longer than tasks themselves). Consider setting new value for the progress bar in the most outer loop. This will reduce processing time significantly. You can't force the default QProgressBar to accept anything else than an int, you'd have to roll out your own progress bar implementation (it's not that complicated, you could subclass QProgressBar and provide your own counters) but I strongly suggest to avoid it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    jesse_mark (9th January 2013)

Similar Threads

  1. to create a circle progressbar
    By wagmare in forum Qt Programming
    Replies: 8
    Last Post: 16th November 2015, 22:45
  2. progressbar from right to left.
    By kumari arpita in forum Newbie
    Replies: 2
    Last Post: 1st August 2012, 07:22
  3. Confused with progressbar
    By hakermania in forum Newbie
    Replies: 2
    Last Post: 23rd January 2011, 10:47
  4. Indefinite ProgressBar
    By csvivek in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2008, 11:02
  5. Progressbar problem
    By thae in forum Qt Programming
    Replies: 4
    Last Post: 4th November 2006, 11:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.