Arsenic
7th August 2008, 22:08
I set up my project, using QT += network
It's a static app and I included QtNetwork.
I made sure all the connections are connected... no problems there...
connect(http, SIGNAL(stateChanged(int)), this, SLOT(DisplayProgress(int)));
connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpRequestFinished(int, bool)));
connect(http, SIGNAL(requestStarted (int)), this, SLOT(httpRequestStarted(int)));
connect(http, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
Neither get(), nor post() has any problem executing. But after that everything seems to go silent.
Like as if the signals aren't working at all.
I put logs everywhere, and not a single connected signal is being emitted. requestStarted doesn't even begin.
I made sure to follow the example in QHttp. I simply put up a GET for a PHP page online. I am online, firewall is off and everything (though it is vista).
void httpRequestStarted(int id){
if(id == httpPostId){
Log2("Started");
} else if (id == httpGetId){
Log2("Started");
}
Log2("Req Started");
}
But nothing is getting logged.
Apparently, either QtNetwork isn't working, or neither get nor post activates httpRequestStarted.
I declared http as a QHttp(this) (this being a QObject class).
The logs just stop here and here:
void cConnect::PostRead(QString data, const QString& siteurl, int encrypt){
//data = Encrypt(data);
httpRequestAborted = false;
httpPostId = http->post(QUrl::toPercentEncoding(siteurl), data.toAscii());
}
This is for GET:
httpRequestAborted = false;
httpGetId = http->get(QUrl::toPercentEncoding(Url), file);
Log2("CC::Downloading File");
How can this be? I never declared a "Host" and I never get the signal for requestStart().
It's a static app and I included QtNetwork.
I made sure all the connections are connected... no problems there...
connect(http, SIGNAL(stateChanged(int)), this, SLOT(DisplayProgress(int)));
connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(httpRequestFinished(int, bool)));
connect(http, SIGNAL(requestStarted (int)), this, SLOT(httpRequestStarted(int)));
connect(http, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int)));
connect(http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, SLOT(readResponseHeader(const QHttpResponseHeader &)));
Neither get(), nor post() has any problem executing. But after that everything seems to go silent.
Like as if the signals aren't working at all.
I put logs everywhere, and not a single connected signal is being emitted. requestStarted doesn't even begin.
I made sure to follow the example in QHttp. I simply put up a GET for a PHP page online. I am online, firewall is off and everything (though it is vista).
void httpRequestStarted(int id){
if(id == httpPostId){
Log2("Started");
} else if (id == httpGetId){
Log2("Started");
}
Log2("Req Started");
}
But nothing is getting logged.
Apparently, either QtNetwork isn't working, or neither get nor post activates httpRequestStarted.
I declared http as a QHttp(this) (this being a QObject class).
The logs just stop here and here:
void cConnect::PostRead(QString data, const QString& siteurl, int encrypt){
//data = Encrypt(data);
httpRequestAborted = false;
httpPostId = http->post(QUrl::toPercentEncoding(siteurl), data.toAscii());
}
This is for GET:
httpRequestAborted = false;
httpGetId = http->get(QUrl::toPercentEncoding(Url), file);
Log2("CC::Downloading File");
How can this be? I never declared a "Host" and I never get the signal for requestStart().