I have the follwing code where moreButton
is a QPushButton
. When I toggle the button, nothing happens.
Shouldn't it show or hide secondaryGroupBox
and tertiaryGroupBox
?
QObject::connect(moreButton, SIGNAL(toggled(bool)), secondaryGroupBox, SLOT(setVisible(bool)));
QObject::connect(moreButton, SIGNAL(toggled(bool)), tertiaryGroupBox, SLOT(setVisible(bool)));
Most likely, your pushbutton is not checkable()
. Try
moreButton->setCheckable(true)
A non-checkable button never emits the toggled(bool)
signal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With