It doesn't make sense to emit a signal without a corresponding object to emit it from, since you wouldn't have anything to connect it to.
So what you want is to pass in a pointer to your DataReceiver
as userData
, and implement a public method which emits the signal. Then you can cast userData
to DataReceiver
and call the method on it.
The following incomplete code attempts to show what I mean
void DataReceiver::emitBlink() { // Should of course also be added in header.
emit blink();
}
...
/// Pass in "this" as userData
VRPNAnalog->register_change_handler(this, handle_analog);
...
void VRPN_CALLBACK handle_analog( void* userData, const vrpn_ANALOGCB a )
{
...
reinterpret_cast<DataReceiver*>(userData)->emitBlink();
...
}