Results 1 to 3 of 3

Thread: Confused with progressbar

  1. #1
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy Confused with progressbar

    I want to perform an update check, having a progressbar going from the one side to another. So, I have this code on the constructor of the dialog that shows the progressbar
    Qt Code:
    1. ui->progressBar->setMaximum(0);
    2. ui->progressBar->setMinimum(0);
    3. ui->progressBar->setValue(-1); //these 3 first lines is to make the progressbar go from the one side to another
    4. ui->progressBar->repaint(); //i don't know if this is needed
    5. perform_check(); //after having the progressbar going, perform a check, a messagebox will be shown informing the user about the news and closing the whole dialog
    To copy to clipboard, switch view to plain text mode 
    (read the comments)
    Unfortunately, When I launch this dialog, everything freezes till i get the first messagebox, then (even if, when I press OK to the messagebox I have this->close() the window opens with the progressbar moving from side to side. I don't know what I'm doing wrong....
    Can you help me? Thx
    Last edited by hakermania; 23rd January 2011 at 09:30.
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Confused with progressbar

    you don't need the repaint, as you should never call that slot unless you exactly know why! Always use update()! Further you should read: http://doc.qt.nokia.com/qq/qq27-responsive-guis.html

  3. The following user says thank you to Lykurg for this useful post:

    hakermania (23rd January 2011)

  4. #3
    Join Date
    Jul 2010
    Location
    /home/hakermania/
    Posts
    233
    Thanks
    129
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Confused with progressbar

    Hey, thank you, it works partly, I've placed through the check process some QCoreApplication:rocessEvents();, the window doesn't stack for a long time, but still the dialog's UI (the one with the progressbar) isn't shown till a messagebox is shown giving information. I used this->update(); too.....
    When you 're trying to help somebody in the newbie section, don't forget that he is a newbie. Be specific and give examples.

Similar Threads

  1. to create a circle progressbar
    By wagmare in forum Qt Programming
    Replies: 8
    Last Post: 16th November 2015, 22:45
  2. Replies: 7
    Last Post: 1st March 2010, 17:49
  3. Filling QPixmap as progressbar
    By NoRulez in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2009, 17:01
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.