Results 1 to 3 of 3

Thread: QNetworkReply readAll error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QNetworkReply readAll error

    (Qt 5.3 version) I have a strange situation with the code that I moved from one project to another. Used to work just fine... Here is the code:


    Qt Code:
    1. void onResult(QNetworkReply* r)
    2. {
    3. QNetworkReply::NetworkError err = r->error(); // no error
    4. bool isfin = r->isFinished(); // returns true;
    5. qint64 bta = r->bytesAvailable(); // returns 988305 (correct size of a file I am trying to download)
    6. r->setReadBufferSize(0); // to set read buffer to be unlimited size (per doc)
    7. QByteArray ba(bta+1000,'0');
    8. ba = r->readAll(); // UNHANDLED EXCEPTION at 0x5D8CA9E8 (msvcr120d.dll), qlist.h line 432
    9. ...
    10. }
    To copy to clipboard, switch view to plain text mode 

    I am puzzled and will appreciate any advise or comment on what is going on and how to resolve it.

    Details:
    void onResult is a slot in a thread class:
    Qt Code:
    1. class downloader : public QThread
    2. {
    3. Q_OBJECT
    4. public:
    5.  
    6. downloadRebate() : QThread() {}
    7. void run() {
    8. _uploadman.reset(new QNetworkAccessManager());
    9. ..
    10. connect(_uploadman.get(), SIGNAL(finished(QNetworkReply*)), this, SLOT(onResult(QNetworkReply*)));
    11. _uploadman->get(upload);
    12. exec();
    13. }
    14. private slots:
    15. void onResult(QNetworkReply* r);
    16. ..
    17. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by TorAn; 21st September 2016 at 00:22.

Similar Threads

  1. Replies: 9
    Last Post: 25th May 2015, 15:25
  2. SIGNAL in QNetworkReply error - SOLVED -
    By monillo in forum Qt Programming
    Replies: 4
    Last Post: 14th May 2015, 22:04
  3. How to find the error in QNetworkReply?
    By Gokulnathvc in forum Newbie
    Replies: 13
    Last Post: 20th April 2012, 10:40
  4. SOLVED: error: QNetworkReply: No such file or directory
    By TheIndependentAquarius in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2011, 09:33
  5. QNetworkReply error handling
    By timmu in forum Qt Programming
    Replies: 5
    Last Post: 25th August 2009, 09:07

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.