I've got two forms, the mainform which opens up a dialog box that has a text box in it. How can I pass the text from the textbox back to the mainform? I've tried alot of different methods but I think I'm missing something simple. Thanks for any help.
+1
A:
The dialog box still exists after it closes. So you can, from the main form, do something like this:
QString text = subform->textEdit->text();
This assumes your dialog box is subform
and the name you gave to the text edit box is textEdit
. Make sure you make textEdit
public in the designer.
If you don't want to make textEdit
public, then you can add a getter to subform
.
Mark Beckwith
2009-06-29 02:01:08
This is basically what I just figured out, I was doing it right..I just "forgot" the proper way to make c++ functions inside classes. I was doing QString getValue() instead of QString MainForm::getValue().
whatWhat
2009-06-29 02:04:27