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(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 &)));
To copy to clipboard, switch view to plain text mode
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");
}
void httpRequestStarted(int id){
if(id == httpPostId){
Log2("Started");
} else if (id == httpGetId){
Log2("Started");
}
Log2("Req Started");
}
To copy to clipboard, switch view to plain text mode
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());
}
void cConnect::PostRead(QString data, const QString& siteurl, int encrypt){
//data = Encrypt(data);
httpRequestAborted = false;
httpPostId = http->post(QUrl::toPercentEncoding(siteurl), data.toAscii());
}
To copy to clipboard, switch view to plain text mode
This is for GET:
httpRequestAborted = false;
httpGetId
= http
->get
(QUrl::toPercentEncoding(Url
),
file);
Log2("CC::Downloading File");
httpRequestAborted = false;
httpGetId = http->get(QUrl::toPercentEncoding(Url), file);
Log2("CC::Downloading File");
To copy to clipboard, switch view to plain text mode
How can this be? I never declared a "Host" and I never get the signal for requestStart().
Bookmarks