I've checked lots of examples and this code is supposed connect to google.com
QNetworkAccessManager * Network_Manager;
Network_Manager = new QNetworkAccessManager(this);
URL = "http://www.google.com/";
QNetworkRequest netRequest
(QUrl(URL
));
Network_Manager->get(netRequest);
QNetworkAccessManager * Network_Manager;
Network_Manager = new QNetworkAccessManager(this);
QString URL;
URL = "http://www.google.com/";
QNetworkRequest netRequest(QUrl(URL));
Network_Manager->get(netRequest);
To copy to clipboard, switch view to plain text mode
But I get this error when trying to compile:
error
: no matching function
for call to QNetworkAccessManager
::get(QNetworkRequest
(&)(QUrl))'candidates are: QNetworkReply* QNetworkAccessManager::get(const QNetworkRequest&)
error: no matching function for call to QNetworkAccessManager::get(QNetworkRequest (&)(QUrl))'
candidates are: QNetworkReply* QNetworkAccessManager::get(const QNetworkRequest&)
To copy to clipboard, switch view to plain text mode
I've added
#include <QNetworkAccessManager>
#include <QtNetwork>
and
QT += network in my .pro
thanks in advance...
Bookmarks