How to take values from QComboBox which is in ui of another class into my mainwindow.cpp class?
-
I have a button in mainwindow ui when clicked a new window with combobox opens.When user selects a option in the ui of this new window and presses OK i should get this value in mainwindow.cpp.How do I do this? please suggest
-
I have a button in mainwindow ui when clicked a new window with combobox opens.When user selects a option in the ui of this new window and presses OK i should get this value in mainwindow.cpp.How do I do this? please suggest
@kishore_hemmady Simply add a getter method which returns the selected value, then call this getter in your main window:
SomeDialog dialog(this); dialog.exec(); auto value = dialog.selectedValue(); -
@kishore_hemmady Simply add a getter method which returns the selected value, then call this getter in your main window:
SomeDialog dialog(this); dialog.exec(); auto value = dialog.selectedValue();@jsulm Thanks I'll try and let you know