PDA

View Full Version : Qhttp get in qt3 to file? file is empty until app is close?



triperzonak
20th September 2008, 10:07
hi,

i want to access the file where i put the http->get, how ever the file remain empty until the application closes? how to solve this?

connect(http, SIGNAL(done(bool)), this, SLOT(read_now()));
.....

QFile *file = new QFile(fileName);
http->setHost(url.host(),url.port() != -1 ? url.port() : 80);
http->get(url.path() +"?" + url.query(),&file);

....

void myclass::readnow()
{
//still empty? how to solve this?
}

thanks

triperzonak
20th September 2008, 16:54
I cannot edit my post.. just want to add SOLVED

i just forgot to call file->close();

adding file->close() to requestfinished() do the trick..

but still, took me for about 2 hours to solve this..