Several ways to achieve this
A) built on the code you wrote... to get one connect at last end...
1- create a custom signal from the groupbox that transmits an int
2- create a slot for each of the checkboxes in the groupbox that accepts a bool and emits the signal created above with correct int for the tabpage
3- create a custom slot on the tabwidget that enables/disables the page that the recieving int is.
this would make the checkboxes connected to the groupbox, the groupbox connected to the tabwidget and the tabpages get a signal from the tabwidget.
line drawing
Checkbox(bool) ----| |--- Tabpage(bool)
Checkbox(bool) ----|--- Groupbox(int) -- Tabwidget(int) ---|--- Tabpage(bool)
Checkbox(bool) ----| |--- Tabpage(bool)
Checkbox(bool) ----| |--- Tabpage(bool)
Checkbox(bool) ----|--- Groupbox(int) -- Tabwidget(int) ---|--- Tabpage(bool)
Checkbox(bool) ----| |--- Tabpage(bool)
To copy to clipboard, switch view to plain text mode
B) easier. several connects
connect each checkbox to each tabpage directly
connect(checkbox1, SIGNAL(clicked(bool)), tabpage1, SLOT(setEnabled(bool)));
connect(checkbox2, SIGNAL(clicked(bool)), tabpage2, SLOT(setEnabled(bool)));
connect(checkbox3, SIGNAL(clicked(bool)), tabpage3, SLOT(setEnabled(bool)));
connect(checkbox1, SIGNAL(clicked(bool)), tabpage1, SLOT(setEnabled(bool)));
connect(checkbox2, SIGNAL(clicked(bool)), tabpage2, SLOT(setEnabled(bool)));
connect(checkbox3, SIGNAL(clicked(bool)), tabpage3, SLOT(setEnabled(bool)));
To copy to clipboard, switch view to plain text mode
cheers,
leif
Bookmarks