Results 1 to 3 of 3

Thread: error: no matching function for call to 'QHttpRequestHeader::setValue(QString*, QStr

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

    Default Re: error: no matching function for call to 'QHttpRequestHeader::setValue(QString*, Q

    im trying to set a QHTTPheader fields. and im using the QHttpHeader::setValue ( const QString & key, const QString & value )
    function. but i face with this error. so whats the problem here!!?

    this is the code and i defined the myReqHeader in hehader file as public.


    void MainWindow::setReqHeaderFild()
    {


    QString a,b;
    a= ui->comboBoxReqField->currentText();
    b= ui->lineEditreqheader->text();

    myReqHeader.setValue( &a, &b);
    }


    the error:::
    error: no matching function for call to 'QHttpRequestHeader::setValue(QString*, QString*)'


    what should i do to make this work?

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: error: no matching function for call to 'QHttpRequestHeader::setValue(QString*, Q

    You need to learn about C++ pointers and references.

    With myReqHeader.setValue( &a, &b) you pass the addresses, that is, pointers, of a and b to setValue, which would correspond with a prototype QHttpHeader::setValue ( QString *key, QString *value )

    Drop the &s and use myReqHeader.setValue(a, b);

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

    Default Re: error: no matching function for call to 'QHttpRequestHeader::setValue(QString*, Q

    i do it befor my friend ... but when i use
    ui->textEdit_4->setText(myReqHeader.toString();
    just HTTP/0.0 printed in textEdit_4 ...
    did u get what i said?
    what happens here?

Similar Threads

  1. error: no matching function for call to ‘QTimer:
    By saman_artorious in forum Qt Programming
    Replies: 2
    Last Post: 21st May 2012, 15:27
  2. about no matching function for call to
    By Alain Delon in forum General Programming
    Replies: 1
    Last Post: 5th March 2011, 21:30
  3. Replies: 1
    Last Post: 1st December 2010, 11:02
  4. Replies: 7
    Last Post: 16th August 2009, 09:03
  5. No Matching function to call...
    By weepdoo in forum Qt Programming
    Replies: 2
    Last Post: 7th November 2008, 17:30

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.