Reputation: 195
So the question is how do I set a value of textEdit from another form?
Upvotes: 0
Views: 213
Reputation: 683
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.
Upvotes: 1
Reputation: 41306
myTextEdit->setPlainText(text)
, myTextEdit->setHtml(text)
or by directly modifying the editor's QTextDocument
instance.
Upvotes: 0