PDA

View Full Version : Receiving reply from page



Trok
29th September 2011, 12:59
I looking for some method of reciving reply from page instead of EventLoop, like here:

bool Engine::connection(){
request.setUrl(QUrl(sUrl));
reply = manager->get(request);
connect(reply, SIGNAL(readyRead()), eventLoop, SLOT(quit()));
eventLoop->exec();
//read reply
return reply->error() ? false : true;
}
How can I read it in a different way without using new slot?
I also tried waitForReadyRead function, but it doeasn't work.

wysota
29th September 2011, 13:17
What's wrong with using an event loop?

Trok
29th September 2011, 13:24
It looks for me very strange when i use in every function loop to recive any data, and don't know why doesn't have function like waitForReadyRead().

wysota
29th September 2011, 13:31
You don't want slots, you don't want event loops... So why are you using Qt in the first place? You want waitForReadyRead() which does the same as waiting on an event loop. If you don't want to write the same code many times then just write a function that will do that for you. You can even call it "waitForReadyRead".