Results 1 to 19 of 19

Thread: No match for operator>>

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: No match for operator>>

    Yes, you can have many return points.

  2. #2
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: No match for operator>>

    Thanks Regards

  3. #3
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: No match for operator>>

    And reffering to lineEdit's text, here's quote from docs:
    This property holds the line edit's text.

    Setting this property clears the selection, clears the undo/redo history, moves the cursor to the end of the line and resets the modified property to false. The text is not validated when inserted with setText().

    The text is truncated to maxLength() length.

    Access functions:

    *
    QString text () const
    *
    void setText ( const QString & )

    See also insert() and clear().
    access functions doesn't say how to refer to lineEdit's text. QString text () const it's just a declaration of a string. void setText ( const QString & ) is to set the lineEdit's text. And I still don't know how to operate on lineEdit's text.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: No match for operator>>

    Quote Originally Posted by Salazaar View Post
    access functions doesn't say how to refer to lineEdit's text.
    Hmm? Do you know the meaning of the word "access"?

    QString text () const it's just a declaration of a string.
    Hmm?

    It's a declaration of a function/method that is called "text", returns a "QString" object and takes no arguments (implicit void).

    void setText ( const QString & ) is to set the lineEdit's text.
    Correct.

    And I still don't know how to operate on lineEdit's text.
    How about just trying to use the "text()" method?

  5. #5
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: No match for operator>>

    Is something like this correct?
    Qt Code:
    1. QString text (lineEdit) const
    To copy to clipboard, switch view to plain text mode 
    is that the "text method"?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: No match for operator>>

    No, it doesn't make any sense.

    Qt Code:
    1. QLineEdit *myEdit;
    2. //...
    3. QString xxx = myEdit->text();
    To copy to clipboard, switch view to plain text mode 

    Please learn a bit of C++...

  7. #7
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: No match for operator>>

    Thanks, now's clear. And if in lineEdit is an integer, I should use int (quint) instead of QString, right?
    edit:
    this problem wasn't about my c++ skills, but logical methods, I had no idea about it

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: No match for operator>>

    Quote Originally Posted by Salazaar View Post
    Thanks, now's clear. And if in lineEdit is an integer, I should use int (quint) instead of QString, right?
    No. if lineEdit is an integer then it already holds its own value.

    edit:
    this problem wasn't about my c++ skills, but logical methods, I had no idea about it
    A lame excuse is better than no excuse...

  9. #9
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: No match for operator>>

    But text can be an integer. So how can I operate on integers which are in lineEdit?

  10. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: No match for operator>>

    Quote Originally Posted by Salazaar View Post
    But text can be an integer. So how can I operate on integers which are in lineEdit?
    Search QString docs and pick a method that converts the string to int.
    J-P Nurmi

  11. #11
    Join Date
    May 2007
    Posts
    315
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: No match for operator>>

    Thanks, I'll read it

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
  •  
Qt is a trademark of The Qt Company.