Have you tried to use QTimer with 0 interval ?
for(int i=0;i<1000;i++)
{
//send HTTP request using QNetworkAccessManager
} // should not affect the gui !!!!!!
// with QTimer:
void MyClass::sendRequest(){
// send request using QNAM
++_requestSent;
if (_requestSent < 1000 && !_abort){
QTimer::singleShot(0,
this,
SLOT(sendRequest
()));
}
}
// will not affect the gui, timeouts will be processed as soon as all gui events have been processed
for(int i=0;i<1000;i++)
{
//send HTTP request using QNetworkAccessManager
} // should not affect the gui !!!!!!
// with QTimer:
void MyClass::sendRequest(){
// send request using QNAM
++_requestSent;
if (_requestSent < 1000 && !_abort){
QTimer::singleShot(0,this,SLOT(sendRequest()));
}
}
// will not affect the gui, timeouts will be processed as soon as all gui events have been processed
To copy to clipboard, switch view to plain text mode
Btw. why do you need to send a thousand http requests ?
Bookmarks