PDA

View Full Version : Using One's widget variables on other Widget



saad_saadi
18th December 2013, 00:36
I made two widgets using QT Designer which have their own header and source files like this,
Widget-1:

form1.ui
ui_form1.h
form1.h
moc_form1.cpp
form1.cpp
main.cpp

Widget-2:

form2.ui
ui_form2.h
form2.h
moc_form2.cpp
form2.cpp
main.cpp

Form1 has QlineEdit and QCheckBox, and user will put the input on the Widget1 and after putting the input. User will press the pushButton and Widget2 will start executing. On Widget2, i want to use the values and conditions of the first widget's LineEdit and ChechBox. Can anyone tell me how i can do this. It will be of great help. Thanks

wysota
18th December 2013, 07:18
Make one form emit signals when corresponding values of its items change and connect those signals to slots in the other widget where you will react on those changes.