View Full Version : radiobutton connect

28th July 2012, 10:45
how to code this: if a the ON radio button is clicked, set the frame to enabled, otherwise disabled,
here, all slots take boolean whereas the clicked signal is void!

connect(ui->display_titleOn, SIGNAL(clicked()), ui->display_titleFrame, SLOT(setEnabled(true)));

28th July 2012, 11:15
qradiobutton is a QAbstractButton and if you look at the ACTUAL signal clicked... QAbstractButton#clicked then you will see that the clicked signal is 'not void'

28th July 2012, 11:15
You can't pass parameters via connect! And use the toggled() signal...

28th July 2012, 13:37
he can use clicked as well.

connect(ui->display_titleOn, SIGNAL(clicked(bool)), ui->display_titleFrame, SLOT(setEnabled(bool)));