How to get toggled() signal working with a QPushButton?
14,923
Most likely, your pushbutton is not checkable()
. Try
moreButton->setCheckable(true)
A non-checkable button never emits the toggled(bool)
signal.
Author by
Iceman
Updated on June 11, 2022Comments
-
Iceman about 2 years
I have the follwing code where
moreButton
is aQPushButton
. When I toggle the button, nothing happens.Shouldn't it show or hide
secondaryGroupBox
andtertiaryGroupBox
?QObject::connect(moreButton, SIGNAL(toggled(bool)), secondaryGroupBox, SLOT(setVisible(bool))); QObject::connect(moreButton, SIGNAL(toggled(bool)), tertiaryGroupBox, SLOT(setVisible(bool)));