Results 1 to 5 of 5

Thread: Error with void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp )"

  1. #1
    Join Date
    May 2012
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Error with void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp )"

    hi friends. Im Working with http and im trying to show the recived response header in a texedit...
    so im trying to use this signal void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp )

    here is the code:
    connect(&myHttp, SINGAL(QHttp::responseHeaderReceived(&myRespHeader )),
    this, SLOT(showRespHeader()));



    myHttp is an instance of QHttp
    myRespHeader is an instance of QHttpResponseHeader
    showResponseHeader() is a defined slot by myself

    but i face with these errors ...

    1. cannot call member function 'void QHttp::responseHeaderReceived(const QHttpResponseHeader&)' without object

    2. 'SINGAL' was not declared in this scope



    who knows ehats wrong here? help me plz
    thnx alot

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error with void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp

    The macro is called SIGNAL() not SINGAL().
    The argument of the SIGNAL() macro is a prototype for the function not a call to it.
    The slot should accept the argument passed with the signal if you expect to do anything useful with it.

    Combining:
    Qt Code:
    1. connect(&myHttp, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), this, SLOT(showRespHeader(QHttpResponseHeader));
    2.  
    3. // and
    4. void showRespHeader(const QHttpResponseHeader& resp)
    5. {
    6. // do something with the HTTP response code you receive, e.g. 302, 404 etc.
    7. }
    To copy to clipboard, switch view to plain text mode 


    My response to the first time you tried to ask this stands. Why didn't you just edit that first post?

  3. #3
    Join Date
    May 2012
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Error with void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp

    thnx alot man... it works correctly now... im new in QT.. would u plz give me some refrences to study?

  4. #4
    Join Date
    Jun 2012
    Location
    Iran , Tehran
    Posts
    93
    Thanks
    5
    Platforms
    Unix/X11 Windows Android

    Default Re: Error with void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp

    you can use socket programming to do your work,that socket connect to port 80 your host

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error with void QHttp::responseHeaderReceived ( const QHttpResponseHeader & resp

    Quote Originally Posted by k.qasempour View Post
    thnx alot man... it works correctly now... im new in QT.. would u plz give me some refrences to study?
    There is a large set of documentation that comes with an copy of Qt. Run Assistant or look at the Help page in Qt Creator.

    This particular problem is related to the information found in Signals and Slots

Similar Threads

  1. Replies: 2
    Last Post: 7th June 2012, 06:28
  2. error: invalid use of void expression
    By ChineseGeek in forum Qt Programming
    Replies: 17
    Last Post: 3rd October 2009, 08:59
  3. Replies: 1
    Last Post: 28th December 2008, 20:13
  4. error: void value not ignored as it ought to be
    By dreamer in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2008, 16:17
  5. QHttp "PUT METHOD" QT Problem File Upload. RFC 2616
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 25th October 2006, 22:02

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.