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

Meir Yanovich meiry242 at gmail.com
Fri Apr 16 23:54:34 CEST 2010


ok i just added :
 connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
after networkManager->get(request);
and its working

On Sat, Apr 17, 2010 at 12:46 AM, Meir Yanovich <meiry242 at gmail.com> wrote:

> so what should i do ?
>
> On Sat, Apr 17, 2010 at 12:22 AM, Thiago Macieira <thiago at kde.org> wrote:
>
>> 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
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100417/3b0a9eb0/attachment.html 


More information about the Qt-interest-old mailing list