I am new to Qt and stumbled across a problem that I could not find an answer for on Google.
Say I want to send an acceleration and velocity field. I define a custom signal :
setProperties(QString,double,double,bool)
However, how do I tell the difference between velocity and acceleration in such a statement?
connect(dialog, SIGNAL(setProperties(QString,double,double,bool)),
this, SLOT(somerandomslot()));
randomslot needs to get the velocity field and acceleration fields and manipulate them, but in the above SIGNAL they are just double.
In this case your
somerandomslot()function should probably have a matching function signature so that the valuesemited in your signal can get passed to it:then your connect call would look like this:
and when your
somerandomslot()gets called you’ll have access to those variables.