Results 1 to 5 of 5

Thread: QNetworkReply and multiple files download

  1. #1
    Join Date
    Feb 2010
    Location
    Russia, Omsk
    Posts
    28
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QNetworkReply and multiple files download

    I use QNetworkReply. I want to download multiple files simultaneously. I'm gonna use http://doc.qt.io/qt-4.8/readyRead signal for reading data of each file. The problem is that I don't know for which of files data amount is ready at the moment. What is the best solution for downloading multiple files chunk by chunk.

  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: QNetworkReply and multiple files download

    Each QNetworkReply object corresponds to one request (and thus one file).
    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
    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: QNetworkReply and multiple files download

    ...use QSignalMapper to identify which replay has sent the signal.

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

    Annihilator (4th April 2012)

  5. #4
    Join Date
    Feb 2010
    Location
    Russia, Omsk
    Posts
    28
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QNetworkReply and multiple files download

    Quote Originally Posted by wysota View Post
    Each QNetworkReply object corresponds to one request (and thus one file).
    That is why I'm asking. Can you get file name from slot binded to readyRead?

    Quote Originally Posted by Lykurg View Post
    ...use QSignalMapper to identify which replay has sent the signal.
    Thanks! That is what I was looking for!

  6. #5
    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: QNetworkReply and multiple files download

    Quote Originally Posted by Annihilator View Post
    Can you get file name from slot binded to readyRead?
    No. The reply doesn't have to be associated with any file. It's just a stream of bytes and it's just you who is interpreting this stream as a file. If the server reports the file name, then it does that most likely as a header in the reply.
    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.


Similar Threads

  1. how to download files in QWebView
    By mentalmushroom in forum Qt Programming
    Replies: 0
    Last Post: 19th August 2011, 09:28
  2. Replies: 1
    Last Post: 14th April 2011, 09:58
  3. Replies: 1
    Last Post: 8th April 2011, 13:45
  4. Replies: 3
    Last Post: 26th October 2010, 22:52
  5. Qt Multiple Ui files.....
    By Rajeshsan in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2010, 04:14

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.