I am a bit confused.
How can I call the quit() or exit without the object? Where to quit? Inside the slot?
What I have now is something like:
void Report::test()
{
QNetworkAccessManager * manager = new QNetworkAccessManager();
QNetworkConfigurationManager config_manager;
manager->setConfiguration(config_manager.defaultConfiguration());
connect( manager, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( webReportGenerateFinished(QNetworkReply*) ));
QNetworkReply
*reply
= manager
->get
(QNetworkRequest
(QUrl("http://192.168.0.199/webreport/shift.php?title=ShiftReport&fromdate=2012-01-03&todate=2012-01-03&shift[]=2&emp[]=1&stationNo=1&lang=1&format=1&rounddp=1")));
loop.exec()
}
void Report::webReportGenerateFinished(QNetworkReply* reply)
{
cout<<"RM generate finished!"<<endl;
..
..
..// call loop.quit() here??? Do not have the loop object actually....
qDebug("RM generate finished!");
}
void Report::test()
{
QEventLoop loop;
QNetworkAccessManager * manager = new QNetworkAccessManager();
QNetworkConfigurationManager config_manager;
manager->setConfiguration(config_manager.defaultConfiguration());
connect( manager, SIGNAL( finished( QNetworkReply* ) ), this, SLOT( webReportGenerateFinished(QNetworkReply*) ));
QNetworkReply *reply = manager->get(QNetworkRequest(QUrl("http://192.168.0.199/webreport/shift.php?title=ShiftReport&fromdate=2012-01-03&todate=2012-01-03&shift[]=2&emp[]=1&stationNo=1&lang=1&format=1&rounddp=1")));
loop.exec()
}
void Report::webReportGenerateFinished(QNetworkReply* reply)
{
cout<<"RM generate finished!"<<endl;
..
..
..// call loop.quit() here??? Do not have the loop object actually....
qDebug("RM generate finished!");
}
To copy to clipboard, switch view to plain text mode
Bookmarks