[Qt-interest] QNetworkReply *reply = networkManager->get(request); can't get the response in the reply

Thiago Macieira thiago at kde.org
Fri Apr 16 23:22:01 CEST 2010


Em Sexta-feira 16. Abril 2010, às 16.12.25, Meir Yanovich escreveu:
>      QEventLoop loop;
>      QNetworkReply *reply = networkManager->get(request);
>      QByteArray data=reply->readAll();
>      ApiResponse.append(data); <--- the data here is empty

The data is empty there on line 4 because you didn't let the reply process. 
You have to wait for the finished() signal between line 2 (the get() ) and the 
attempt at reading.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100416/4e5c641f/attachment.bin 


More information about the Qt-interest-old mailing list