Hello, I am trying to use function pointers as parameters in signals and slots
but get some compiler errors. What would be the right syntax to do it???
Thanks.
ps. This is my function pointer for example:
void (*pt2Function
)(void* pt2Object,
QString text
)
void (*pt2Function)(void* pt2Object, QString text)
To copy to clipboard, switch view to plain text mode
How do I emit it in a signal???
ps. I have successfully declared the signal in the header file, like this:
typedef void (*ApplyFunction
)(void* pt2Object,
QString text
);
signals:
void test(ApplyFunction func);
typedef void (*ApplyFunction)(void* pt2Object, QString text);
signals:
void test(ApplyFunction func);
To copy to clipboard, switch view to plain text mode
But when I try to emit it like this:
emit test(pt2Function(pt2Object, "Name of Logged in user"));
emit test(pt2Function(pt2Object, "Name of Logged in user"));
To copy to clipboard, switch view to plain text mode
I get an error. Any help appreciated.
Bookmarks