While implementing the interface to a device there is code like the following in MyClass
constructor
pDeviceInstance = new Device()
pDeviceInstance->loadLibrary();
pDeviceInstance->Create(functionpointer)
There are asyncronous events comming out and calling functionpointer
(which I would like to deal with).
Both functionpointer
and pDeviceInstance
are static
.
I would like to emit a Qt signal from inside functionpointer
but because it is static
its not possible to emit the signal.
I tried:
To make
functionpointer
a lambda in the hope to emit signals from inside the lambda. But for that to happen lambda needs to capturethis
, and in order for the lambda to decay to a function pointer it cannot capture anything.To make
functionpointer
nonstatic
but in that case it seems to be a function pointer ofMyClass
which is different type.
So, I'm running out of options in my plan of emit a Qt signal from inside that functionpointer
.
Is there anything I'm missing here?