Results 1 to 2 of 2

Thread: Qhttp get in qt3 to file? file is empty until app is close?

  1. #1
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Qhttp get in qt3 to file? file is empty until app is close?

    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

  2. #2
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qhttp get in qt3 to file? file is empty until app is close?

    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..

Similar Threads

  1. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  2. Retrieving modified date of file using QHttp
    By hardgeus in forum Qt Programming
    Replies: 9
    Last Post: 3rd December 2006, 23:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.