I am using Qt 4.7 for my current project. I have a QWebView object in a Dialog that I need to display a webpage that requires postdata (it is the result of a search). I have the following so far:
QNetworkAccessManager *nam;
ui->webView->page()->setNetworkAccessManager(nam);
QUrl url;
url.setHost("http://myhost.com");
url.setPath("/mypath.php");
QString postdata("value1=x&value2=y");
QNetworkRequest request(url);
ui->webView->load(request, QNetworkAccessManager::PostOperation, postdata.toStdStdring().c_str());
I tried to follow the docs as closely as possible, but they were very lacking in descriptions of this function and I had trouble finding much else online about it. When I run this in the browser using the same host and path, and the same data which I determined from tampering the request, I get the correct page. However, when I run it in the app, the webView is blank. Does anyone know what I may be doing wrong? I feel like it might be something simple, but like I said I had a hard time finding much that was helpful. Thanks!