I've got an easy GUI window: a QLineEdit with a QPushButton. I want to trigger a signal when when the push button is clicked AND the input is validated (it meets a conditional statement, nevermind the details).
Normally I would use connect (object, signal, subject, slot)
. I guess that QPushButton clicked should trigger the middle-signal which is handled inside the widget slot. And the widget slot could trigger another signal - to my destination point. But how?
You have to declare your signal in class:
class myClass
{
/* stuff */
public signals:
void mySignal();
}
and in your code after validation:
void myClass::dataValidation()
{
/*validate data*/
emit mySignal();
}
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