dineshkumar
19th January 2011, 10:27
hi i want to do a qt mobile apps which using network access but while compiling my code it shows the following errors.
i. invalid use of this in non member function
ii. connect was not declared in this scope
I have do the following in my code:
.pro file:
QT += network
main.cpp file
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtNetwork>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
#if defined(Q_WS_S60)
w.showMaximized();
#else
w.show();
#endif
return a.exec();
}
Is it any problem with my code please help me. Thanks.
i. invalid use of this in non member function
ii. connect was not declared in this scope
I have do the following in my code:
.pro file:
QT += network
main.cpp file
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtNetwork>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
#if defined(Q_WS_S60)
w.showMaximized();
#else
w.show();
#endif
return a.exec();
}
Is it any problem with my code please help me. Thanks.