PDA

View Full Version : How to add QTextEdit to QWizard



slava
1st February 2008, 10:16
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:


ClassWizard::ClassWizard(QWidget *parent)
: QWizard(parent)
setDefaultProperty("QTextEdit", "toPlainText", "textChanged")
.....

but that doesn't help and the

registerField("text", textEdit)
still shows empty on

QMessageBox (.....field("text").toString())
while the textBox is filled.
-
I have tryied:

QVariant txt = textEdit->toPlainText();
setField("text", txt);
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?

wysota
1st February 2008, 10:49
Not "toPlainText" but "plainText".

slava
1st February 2008, 11:01
Not "toPlainText" but "plainText".

unfortunatelly no, did not react... still all the textEdit boxes are reported to be empty while filled with the text :(

wysota
1st February 2008, 11:06
registerField("textfield", textEdit, "plainText");

slava
1st February 2008, 11:46
registerField("textfield", textEdit, "plainText");

Thank you very much. That worked just fine!