PDA

View Full Version : [Qt4 QHttp] can't make it work



rodo
9th April 2007, 21:19
Here is a piece of code...




QHttp* http = new QHttp(this);

connect(http, SIGNAL(done( bool )), this, SLOT(parseResponse( bool )));
connect(http, SIGNAL(stateChanged( int )), this, SLOT(stateChanged( int )));
connect(http, SIGNAL(requestStarted( int )), this, SLOT(requestStarted( int )));

http->setHost(_host); // _vhost = 'www.aserver.com';
http->get(_vurl); // _vurl = '/afile.xml';



this is in a method of an QObject and all the slots are defined in the right way ...

after sending the get method no signal is emitted at all ... the signals are well connected since there is no warnings at the output ...

and i can't figure out what is wrong...

if anybody can help me... I'll appreciate it

marcel
10th April 2007, 00:57
How about setHost? Is a signal emitted when the request is started?
If so, then maybe get fails in some way...

guilugi
10th April 2007, 14:12
Hard to tell with this small sample...
At this point, it seems correct to me.
It would be interesting to see the class containing this code.

Don't be afraid to post a small compilable sample ( it seems I write this sentence all the time :rolleyes: )

rodo
10th April 2007, 17:33
It is fixed....

it seems that some how, the events of the qhttp stays queued in the event loop, with out doing a thing ... a


QApplication::processEvents();

fixed this up ...