Results 1 to 4 of 4

Thread: [Qt4 QHttp] can't make it work

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default [Qt4 QHttp] can't make it work

    Here is a piece of code...

    Qt Code:
    1. QHttp* http = new QHttp(this);
    2.  
    3. connect(http, SIGNAL(done( bool )), this, SLOT(parseResponse( bool )));
    4. connect(http, SIGNAL(stateChanged( int )), this, SLOT(stateChanged( int )));
    5. connect(http, SIGNAL(requestStarted( int )), this, SLOT(requestStarted( int )));
    6.  
    7. http->setHost(_host); // _vhost = 'www.aserver.com';
    8. http->get(_vurl); // _vurl = '/afile.xml';
    To copy to clipboard, switch view to plain text mode 

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [Qt4 QHttp] can't make it work

    How about setHost? Is a signal emitted when the request is started?
    If so, then maybe get fails in some way...

  3. #3
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [Qt4 QHttp] can't make it work

    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 )

  4. #4
    Join Date
    Apr 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: [Qt4 QHttp] can't make it work

    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

    Qt Code:
    1. QApplication::processEvents();
    To copy to clipboard, switch view to plain text mode 

    fixed this up ...

Similar Threads

  1. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. Why can't I make dynamic_cast work properly?
    By pir in forum General Programming
    Replies: 13
    Last Post: 18th July 2006, 16:17

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.