.......... QNetworkAccessManager manager; QNetworkReply *reply; QUrl apiUrl; QByteArray requestString;.......... apiUrl = "http://localhost/index.php"; requestString = "n=1111"; QNetworkRequest request(apiUrl); reply = manager.post(request,requestString); connect(reply, SIGNAL(finished()),this, SLOT(getReplyFinished())); connect(reply, SIGNAL(readyRead()),this, SLOT(readyReadReply()));.................
<?php echo $_POST['n'];?>
.......................................private slots: void getReplyFinished(); void readyReadReply();private: QNetworkAccessManager manager; QNetworkReply *reply; QUrl apiUrl; QByteArray requestString;.......................................
....................................... apiUrl = "http://localhost/index.php"; requestString = "n=1111"; QNetworkRequest request(apiUrl); reply = manager.post(request, requestString); connect(reply, SIGNAL(finished()),this, SLOT(getReplyFinished())); connect(reply, SIGNAL(readyRead()),this, SLOT(readyReadReply()));..........................................void MainWindow::getReplyFinished(){ reply->deleteLater(); QByteArray data; data = reply->readAll(); ui->webView->setHtml(data);}