PDA

View Full Version : Passing variable from tab to tab in QTabWidget



saad_saadi
3rd January 2014, 07:32
I am newbie to QT and currently working on one QTabWidget which have two tabs means two widgets, as such


tabWidget->addTab(new First_Widget(),tr("Home"));
tabWidget->addTab(new Second_Widget(), tr("Download"));

First Widget have some integers and floats values which i want to use in the second widget. I can make a constructor of second widget like this



tabWidget->addTab(new Second_Widget(argument1, argument2,argument3), tr("Download"));

and i think i can call second tab form the first widget but in that case the second tab will be hide until i don't click the respective button. Can anyone tell me how i can use first tab's values in the second.

wysota
3rd January 2014, 08:04
Use signals and slots to synchronize widget values.