So the question is how to set a value of textEdit from another form?
P.S. Sorry for my English.
So the question is how to set a value of textEdit from another form?
P.S. Sorry for my English.
myTextEdit->setPlainText(text)
, myTextEdit->setHtml(text)
or by directly modifying the editor's QTextDocument
instance.
You have two options, either you can simply call one of the setText
functions from a function within another form like this:
otherForm->setPlainText(text);
Or you could connect the two forms with signals like this:
connect(form1, SIGNAL(updateText(const QString&)),
form2->myTextEdit, SLOT(setText(const QString&)))
Either of these are valid ways to do it.