Results 1 to 3 of 3

Thread: QTextEdit::text()

  1. #1
    Join Date
    Jul 2009
    Posts
    22
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTextEdit::text()

    Hello, when ever I make a QTextEdit object I can never get it's text to a QString nor a normal string. In the help pages I got this information that to do what i need we use the QTextEdit::text() method and that doesn't work, i tried a line like this:

    //str is a QString
    //txt is a QTextEdit

    str = txt.text();

    Obviously it must be a little more complicated then that.

    Thank for now.
    class newbie: public QWidget { };

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextEdit::text()

    hm, don't understand what you need... but, have you see QTextEdit::toPlainText?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following user says thank you to spirit for this useful post:

    hazardpeter (5th August 2009)

  4. #3
    Join Date
    Jul 2009
    Posts
    22
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit::text()

    XD, that was what I has lokking for!!

    I can't belive that I saw that method so many times in the help pages and didn't notice it. I guess i has just to tired.

    But thank's very very must, lolol
    class newbie: public QWidget { };

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.