Results 1 to 5 of 5

Thread: How to add QTextEdit to QWizard

  1. #1
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Question How to add QTextEdit to QWizard

    Hello,
    I would like to get some kind of hint as to how handle QWizard object in the programming. I had a need to use QTextEdit in a QWizardPage but QTextEdit is not supported by default there, only QLineEdit etc. The manual says I can add QTextEdit by, for example:

    Qt Code:
    1. ClassWizard::ClassWizard(QWidget *parent)
    2. : QWizard(parent)
    3. setDefaultProperty("QTextEdit", "toPlainText", "textChanged")
    4. .....
    To copy to clipboard, switch view to plain text mode 
    but that doesn't help and the
    Qt Code:
    1. registerField("text", textEdit)
    To copy to clipboard, switch view to plain text mode 
    still shows empty on
    Qt Code:
    1. QMessageBox (.....field("text").toString())
    To copy to clipboard, switch view to plain text mode 
    while the textBox is filled.
    -
    I have tryied:
    Qt Code:
    1. QVariant txt = textEdit->toPlainText();
    2. setField("text", txt);
    To copy to clipboard, switch view to plain text mode 
    but that still doesn not work and the field "text" stil empty.
    -
    Could you help me to find out how do I go about this to be able to use QTextEdit in QWizard pages?
    Last edited by jpn; 1st February 2008 at 10:03. Reason: missing [code] tags

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

    Default Re: add QTextEdit to QWizard

    Not "toPlainText" but "plainText".

  3. #3
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Unhappy Re: add QTextEdit to QWizard

    Quote Originally Posted by wysota View Post
    Not "toPlainText" but "plainText".
    unfortunatelly no, did not react... still all the textEdit boxes are reported to be empty while filled with the text

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

    Default Re: add QTextEdit to QWizard

    Qt Code:
    1. registerField("textfield", textEdit, "plainText");
    To copy to clipboard, switch view to plain text mode 

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

    slava (1st February 2008)

  6. #5
    Join Date
    Feb 2008
    Posts
    43
    Thanks
    14

    Thumbs up Re: add QTextEdit to QWizard

    Quote Originally Posted by wysota View Post
    Qt Code:
    1. registerField("textfield", textEdit, "plainText");
    To copy to clipboard, switch view to plain text mode 
    Thank you very much. That worked just fine!

Similar Threads

  1. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  2. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25
  3. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  4. Painting to QTextEdit
    By gesslar in forum Qt Programming
    Replies: 8
    Last Post: 18th February 2006, 18:40
  5. Obtaining clean (x)html from QTextEdit
    By ccf_h in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2006, 14:47

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.