Results 1 to 8 of 8

Thread: Multiple requests with QNetworkAccessManager

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Music For DJs Downloads mp3

    You can also use QObject::sender() to get the reply object in the finished slot
    Qt Code:
    1. void MainWindow::handleUpdateXML()
    2. {
    3. QNetworkReply *updateReply = qobject_cast<QNetworkReply*>(QObject::sender());
    4.  
    5. QString xml = QString::fromUTF8(updateReply->readAll());
    6. // Actions beng performed to read the XML data and so on...
    7. updateReply->deleteLater();
    8. }
    To copy to clipboard, switch view to plain text mode 

    Even if you are only using one slot for all replies, you can still identify the request because each reply object contains the QNetworkRequest it was created for

    Cheers,
    _

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

    ljuhrich (6th June 2013)

Similar Threads

  1. QNetworkAccessManager in multiple threads
    By mentalmushroom in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2013, 23:14
  2. QNetworkAccessManager and multiple QNetworkReply
    By Acid in forum Qt Programming
    Replies: 2
    Last Post: 22nd August 2012, 22:52
  3. Multiple QNetworkAccessManager requests.
    By Diath in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2011, 22:04
  4. Replies: 4
    Last Post: 19th January 2011, 13:49
  5. Tracking multiple requests with QNetwork
    By rbp in forum Qt Programming
    Replies: 4
    Last Post: 1st June 2010, 08:04

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
  •  
Qt is a trademark of The Qt Company.