ggdev001
6th February 2013, 07:12
Hello, I am developing app on BB 10 using C++ and I have this code from QT web site where in the end I want to establish HTTP connection with server and get JSON
data. But first here is the code where I also try to register slot and send get request.
// Creates the network access manager and connects a custom slot to its
// finished signal. Checks the return value for errors.
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
bool res = connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
Q_ASSERT(res);
// Indicate that the variable res isn't used in the rest of the app, to prevent
// a compiler warning
Q_UNUSED(res);
manager->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
The problem is that during the debug, the "res" variable is False, after the "connect" line
gets executed. Is this the correct behaviour? thanks.
data. But first here is the code where I also try to register slot and send get request.
// Creates the network access manager and connects a custom slot to its
// finished signal. Checks the return value for errors.
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
bool res = connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
Q_ASSERT(res);
// Indicate that the variable res isn't used in the rest of the app, to prevent
// a compiler warning
Q_UNUSED(res);
manager->get(QNetworkRequest(QUrl("http://qt.nokia.com")));
The problem is that during the debug, the "res" variable is False, after the "connect" line
gets executed. Is this the correct behaviour? thanks.