hai,

Qt Code:
  1. void HttpPost::on_pushButton_clicked()
  2. {
  3. params.addQueryItem("testSample","indu");
  4. postData = params.encodedQuery();
  5. manager->setCookieJar(new QNetworkCookieJar(manager));
  6. connect (manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(replyFinish(QNetworkReply*)));
  7. manager->post(req, postData);
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. void HttpPost::replyFinish(QNetworkReply* reply)
  2. {
  3.  
  4. QString answer = QString::fromUtf8(reply->readAll());
  5. qDebug() << "answer------------>"<<answer;
  6.  
  7. }
To copy to clipboard, switch view to plain text mode 


This code is working for me but i don't want to use the "connect" here. I want the reply in the same function. I used
if (reply->isFinished()==true) but it doesnt work
How to wait until the request has finished and then process the reply within one function