Using the old syntax, it was possible to forward a signal eg:
connect(sender, SIGNAL(valueChanged(QString,QString)), this, SIGNAL(updateValue(QString,QString)));
I like using the new Qt5 syntax. Is it possible to use the new syntax to forward a signal?
This ensures that truly independent components can be created with Qt. You can connect as many signals as you want to a single slot, and a signal can be connected to as many slots as you need. It is even possible to connect a signal directly to another signal.
So in normal cases, it will be synchronous and blocking, and with queued connections it will be asynchronous and non-blocking.
QMetaObject::Connection myConnect; myConnect=connect(myReadTimer,SIGNAL(timeout()),this,SLOT(ReadMyCom())); ... disconnect(& myConnect);
Signal is nothing more than just a plain method. So you can use it as is. Something like this:
connect(sender, &Sender::valueChanged, receiver, &Receiver::updateValue);
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