Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

src_network_access_qnetworkaccessmanager.cpp

//! [0]
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
        this, SLOT(replyFinished(QNetworkReply*)));

manager->get(QNetworkRequest(QUrl("http://qtsoftware.com")));
//! [0]


//! [1]
QNetworkRequest request;
request.setUrl(QUrl("http://qtsoftware.com"));
request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");

QNetworkReply *reply = manager->get(request);
connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),
        this, SLOT(slotError(QNetworkReply::NetworkError)));
connect(reply, SIGNAL(sslErrors(QList<QSslError>)),
        this, SLOT(slotSslErrors(QList<QSslError>)));
//! [1]

Generated by  Doxygen 1.6.0   Back to index