Results 1 to 3 of 3

Thread: QProgressDialog and Network donwload

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QProgressDialog and Network donwload

    Hello!

    I need to implement a QProgressDialog to show the download from the web, and for that I'm using QNetworkAcessManager + QNetworkReply.

    The problem is that as far as I know, in order for the QProgressDialog to work properly, I need to set the minimum and maximum value, i.e. 0 bytes and the size of the file I'll be downloading, which is not predefined. I tried to find functions in the network classes that could show me the size of the file I'm downloading before start it, but I didn't, and despite I can use the value shown in the signal downloadProgress(qint64,qint64), I don't want to use this way (i.e. I want to start the progress dialog already with the maxium value set). Given the fact that the signal shows the size of the file, how can I find that information?

    Obs.: I'm downloading the file from a url.


    Thanks,

    Momergil

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QProgressDialog and Network donwload

    In a general case you can't know the size of the download before you start downloading as the size is reported by the server in response headers for the request.
    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 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QProgressDialog and Network donwload

    Quote Originally Posted by wysota View Post
    In a general case you can't know the size of the download before you start downloading as the size is reported by the server in response headers for the request.
    Hmm, in which case I'll have to continue as it is.


    OK, than; at least it's working.


    Thanks,


    Momergil

Similar Threads

  1. Problem with QProgressDialog
    By anoraxis in forum Newbie
    Replies: 1
    Last Post: 6th April 2011, 23:23
  2. Need help in QProgressDialog
    By santhoshv84 in forum Qt Programming
    Replies: 3
    Last Post: 12th September 2008, 19:24
  3. QProgressDialog
    By samirg in forum Qt Programming
    Replies: 5
    Last Post: 5th September 2007, 17:37
  4. qprogressDialog
    By mickey in forum Qt Programming
    Replies: 5
    Last Post: 17th July 2006, 15:16
  5. setLabel in QprogressDialog
    By mickey in forum Newbie
    Replies: 5
    Last Post: 12th July 2006, 12:19

Tags for this Thread

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.