Results 1 to 5 of 5

Thread: how can I take text ?

  1. #1
    Join Date
    Jul 2008
    Posts
    25
    Thanks
    4
    Qt products
    Qt4

    Default how can I take text ?

    How can I take all text (also with signs: '\n' !!!!!! <- it is very important because I must know where are ENTERs) from QTextEdit and situate it in QString str ?

    Qt Code:
    1. QString str = textedit1.text()
    To copy to clipboard, switch view to plain text mode 

    Doesn't work.
    Last edited by newplayer; 30th July 2008 at 08:56.

  2. #2
    Join Date
    Jan 2008
    Location
    Finland /Pakistan
    Posts
    216
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how can I take text ?

    I havent used QTextEdit but what i found that i could not find any function named text
    QString str = textedit1.text()
    maybe you can use toHtml() or toText() depending on what do you require in your string..

  3. #3
    Join Date
    Jul 2008
    Posts
    25
    Thanks
    4
    Qt products
    Qt4

    Default Re: how can I take text ?

    I can't compile it: `toText' has not been declared

  4. #4
    Join Date
    Jan 2008
    Location
    Finland /Pakistan
    Posts
    216
    Thanks
    20
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how can I take text ?

    sorry my mistake it is toPlainText()..
    look into the docs of QTextEdit http://doc.trolltech.com/4.4/qtextedit.html#details

  5. The following user says thank you to salmanmanekia for this useful post:

    newplayer (30th July 2008)

  6. #5
    Join Date
    Jul 2008
    Posts
    25
    Thanks
    4
    Qt products
    Qt4

    Default Re: how can I take text ?

    It works !! xD

    Thx

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. Match the text beetween two string
    By dreamer in forum Qt Programming
    Replies: 4
    Last Post: 20th May 2008, 14:48
  4. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  5. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15: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.