me again! :-[
I'm trying to write a simple downloader in qt. it's based on this example: http://www.ggkf.com/qt/qnetworkrequest-to-download-an-image
downloader.cpp:
void Downloader::GetImage( QString _url, QNetworkAccessManager *qnam ) {
connect( qnam, SIGNAL( finished( QNetworkReply *) ), this, SLOT( replyFinished( QNetworkReply * ) ) );
QUrl url = QUrl( _url );
QNetworkRequest request( url );
qnam->get( request );
}
but i get the following error:
/Users/name/ssl/downloader.cpp:19: error: use of undeclared identifier 'connect'
connect( qnam, SIGNAL( finished( QNetworkReply *) ), this, SLOT( replyFinished( QNetworkReply * ) ) );
can anyone of you explain me this error? :-)
thanks in advance
please ensure Downloader does inherit from QObject.
class Downloader : public QObject{
}