MyObject::sendLastPost()
{
QNetworkAccessManager * manager = new QNetworkAccessManager;
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(logout()));
post(request, data); //Send Data, for which reply is not cared for, and also ignore post fails
}
void MyObject::logout(void) //slot, don't call direclty
{
QNetworkAccessManager * manager = dynamic_cast<QNetworkAccessManager *>(sender());
if(manager)
{
disconnect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(logout()));
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(deleteLater()));
post(request, data); //Send Logout data
}
}
MyObject::sendLastPost()
{
QNetworkAccessManager * manager = new QNetworkAccessManager;
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(logout()));
post(request, data); //Send Data, for which reply is not cared for, and also ignore post fails
}
void MyObject::logout(void) //slot, don't call direclty
{
QNetworkAccessManager * manager = dynamic_cast<QNetworkAccessManager *>(sender());
if(manager)
{
disconnect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(logout()));
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(deleteLater()));
post(request, data); //Send Logout data
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks