Results 1 to 7 of 7

Thread: QProgressBar doesn't increment!!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QProgressBar doesn't increment!!

    Hi to all!
    I am developing an application that has the possibility to download a file from a LAN.

    The problem is that i can t figure it out why the progress bar doesn't increment!! i made some experiments without success!!
    i found an article that explains exactly what i need but the code doesn't work (even copy & paste) ! (http://www.thinking-man.com/blog/ent...rogress-Dialog)
    I can t show my own code so please refer to the code on the site above..

    i think the problem is that progressbar doesn't know the dimension of the remote file so it can t calculate the total amount of space required and finally it can t set the maximum Value with setMaximum....

    Someone can help pls?

    Thanks!

  2. #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: QProgressBar doesn't increment!!

    Make sure you are not blocking the event loop and that the loop is running.
    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.


  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProgressBar doesn't increment!!

    if you cant do setMaximum then it wont progress ofcourse

  4. #4
    Join Date
    Sep 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProgressBar doesn't increment!!

    Quote Originally Posted by nish View Post
    if you cant do setMaximum then it wont progress ofcourse
    yes! i thought the same! so the next question is : how do i know the size of a remote file? obviously that size is not constant in time.
    today it could be 1 MB and the day after 1.2MB and so on...

    thanks for the answers

  5. #5
    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: QProgressBar doesn't increment!!

    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.


  6. #6
    Join Date
    Sep 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProgressBar doesn't increment!!

    Quote Originally Posted by wysota View Post
    i used it! and if i print the two parameters : the first one it s ok! the second one is -1. The second one corresponds to the total bytes should be downloaded.

    other suggestions?

    thanks!

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QProgressBar doesn't increment!!

    Sometimes its not possible to know the size of the file to be downloaded.

    In these cases, use a indeterminate progress bar.

Similar Threads

  1. QListWidget string increment
    By nagabathula in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2010, 09:19
  2. QProgressBar "crash" - doesn't work properly
    By metRo_ in forum Qt Programming
    Replies: 6
    Last Post: 23rd October 2010, 13:56
  3. Increment and Decrement Program
    By priya in forum Qt Programming
    Replies: 3
    Last Post: 3rd February 2010, 13:27
  4. QSqlQuery: Getting an Auto Increment value
    By Al_ in forum Qt Programming
    Replies: 3
    Last Post: 23rd December 2009, 22:15
  5. Replies: 4
    Last Post: 9th May 2008, 17:02

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.