0

I used the advice from How can i get content of web-page to download a page using QT QNetworkAccessManager. Here is the code I have:

Header:

class WebAccessor : public QObject{
 Q_OBJECT
public:
 WebAccessor();
 void fetch(const QString &url);
public slots:
 void replyFinished(QNetworkReply *reply);
private: 
 QNetworkAccessManager *netManager_;
 QString pageData_;  
};

Cpp:

WebAccessor::WebAccessor(){
 netManager_ = new QNetworkAccessManager(this);
 connect(netManager_, SIGNAL(finished(QNetworkReply *)), 
       this, SLOT(replyFinished(QNetworkReply *)));
}

void WebAccessor::fetch(const QString &url){
 netManager_->get(QNetworkRequest(QUrl(url)));
}

void WebAccessor::replyFinished(QNetworkReply *pReply){
 QByteArray data = pReply->raedAll();
 pageData_ = QString(data);
}

I have included the QtNetworkd4.lib in project's dependencies, but I get the following error:

error C2027: use of undefined type 'QNetworkReply'

Please let me know if I've missed anything... I think that I'm not linking the library properly.

Community
  • 1
  • 1
ravil
  • 597
  • 2
  • 4
  • 18

1 Answers1

1

What about:

 #include <QNetworkReply>
tibur
  • 11,531
  • 2
  • 37
  • 39
  • Ohh. Thanks so much for pointing it out! I missed the most obvious problem. All other includes were in place but this one. I guess it threw me off that it still recognized the symbol. Thanks again! :) – ravil Jan 20 '11 at 18:32