Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt5 forward signals

Tags:

qt

qt5

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?

like image 476
Bevan Collins Avatar asked Feb 20 '13 01:02

Bevan Collins


People also ask

Can you connect a signal to a signal on Qt?

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.

Are Qt signals asynchronous?

So in normal cases, it will be synchronous and blocking, and with queued connections it will be asynchronous and non-blocking.

How do I turn off Qt signal?

QMetaObject::Connection myConnect; myConnect=connect(myReadTimer,SIGNAL(timeout()),this,SLOT(ReadMyCom())); ... disconnect(& myConnect);


1 Answers

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);
like image 110
ixSci Avatar answered Sep 23 '22 01:09

ixSci