i'm having an issue with the following signal-slot
QCheckBox *hasNotify = new QCheckBox;
connect(hasNotify, SIGNAL(stateChanged(int state)), this, SLOT(showhideNotify(int state)));
I get this in my application output
QObject::connect: No such signal QCheckBox::stateChanged(int state)
But here http://qt-project.org/doc/qt-5/qcheckbox.html#stateChanged they say this signal is included in QCheckBox, so I'm confused about what the problem is.
signal and slots parameters must not contain any variable names, so you should write
connect(hasNotify, SIGNAL(stateChanged(int)), this, SLOT(showhideNotify(int)));
Take a look at documentation here
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