okay here is the deal
it works with integers .
suppose I make I=54 in mainwindow and print I in another window , it shows 54.
but it doesn't work with QStrings.
when I acesss qstring q from dialog 'dialog' , it show "" ;
okay here is the deal
it works with integers .
suppose I make I=54 in mainwindow and print I in another window , it shows 54.
but it doesn't work with QStrings.
when I acesss qstring q from dialog 'dialog' , it show "" ;
It works with QString. If it doesn't work for you then you did something wrong.
Hello Wysota,
Just a note, since there are two threads for the same user about the same topic, even having the same title , why dont you move them into one thread ?
that's the other thread Accessing the same variable from multiple windows.
It would be better instead of going through to the two threads every now and then.
Thanks in advance Sir.
Best Regards.
Last edited by toufic.dbouk; 9th October 2013 at 10:42.
Hey guys!
I have sort of the same question as harvey_slash. Whenever you press the button "add" in my MainWindow it will open a dialog in which you can fill in some line-edits. Each of the line-edits will be assigned to a specific QString variable. And all of those QStrings will be put into a class of my own making. Then, whenever I post the "save" button whithin the dialog I would like it to put that object with the QStrings into a QVector that I have created in my MainWindow. I am struggling unfortunately with sending that object to my MainWindow. Can any of you please help me out?![]()
If you have a modal dialog, just add a getter function and call it when exec() returns.
If you have a non-modal dialog, emit the value with a custom signal.
Cheers,
_
Thanks for your response!
So, if I understand correctly, you can only send one value at a time. It isn't possible for me to send an entire object holding more variables using the signal slot mechanism?
Thanks!
Bookmarks