Passing Value from textbox of one form to the textbox of another form
Hello Everyone!
I am working on a project in which I have to pass a string of one form (named as Dialog) to the string of another form (named as Browser). Please let me know whats the easiest way to do that also let me know if there is any option that a form owns another form in QT
With Regards,
Re: Passing Value from textbox of one form to the textbox of another form
There are a lot of different ways.
Every widget is a C++ object, so anyone holding pointers to a widget can call getter and setter methods.
So one option is to call the text retrieval method on the first text box, take the returned QString object and pass it to the text setter of the second text box.
If you need the two texts to be synchronized, you can create two signal/slot connections between them, so one always updates the other and vice versa.
And, again since this is C++, you can always have the pointer to a form owned by any other class representing a form.
Cheers,
_
Re: Passing Value from textbox of one form to the textbox of another form
Thank You very much for your prompt reply, Can you please suggest an example for pointers?
Re: Passing Value from textbox of one form to the textbox of another form
Basically every Qt example out there contains access of widget properties by calling methods on object pointers
Cheers,
_