qt-interest@trolltech.com
[Top] [All Lists]

Re: HTTP-get in one function.

Subject: Re: HTTP-get in one function.
From: Tobias Doerffel
Date: Thu, 2 Nov 2006 11:21:25 +0100
> I need a hint for a solution with that a could make a function like
>
>
> QString func1()
> {
> QString output;
> http = new Qhttp();
> http->setHost("bla.org");
>
> ....
>
> return(output);
> }
you need to connect the signals emitted by QHttp. I had the same problems a 
few weeks ago and wrote a small helper-class, see

http://svn.sourceforge.net/viewvc/lupus/lupus/src/protocol_handler_http.h?revision=9&view=markup
http://svn.sourceforge.net/viewvc/lupus/lupus/src/protocol_handler_http.cpp?revision=9&view=markup

for details. You could use QBuffer as io-device and convert initialize your 
return-string with QBuffer::buffer().

toby
<Prev in Thread] Current Thread [Next in Thread>