Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
How to pass slot as parameter?
whynoitwork last edited by
I don't understand how to do this like for example:
@void RequestMessage(SLOT *callback)
I want someone to be able to specify a function on which they get the callback.
andreyc last edited by
SLOT is a "function":http://qt-project.org/doc/qt-5/signalsandslots.html#slots. It can either member of a class or standalone function.
If you need to pass a slot to another function then declare that another function with pointer to a slot-function as a parameter and then call that parameter. An example with member function:
void otherFunction(void (A::*param)(int))