[Development] invokeMethod() with function pointers

Benjamin TERRIER b.terrier at gmail.com
Sat Jan 14 17:28:01 CET 2017


Hi everyone,

I'm trying to contribute by making QMetaObject::invokeMethod() take function
pointers instead of function names.

I've come up with something that works by looking at the code of
QMetaObject::invokeMethod, QObject::connect and QMetaObject::activate.

However it does not check for parameters and it is implemented as a function
of QObject (because I needed QSlotObjects classes which are not available in
qobjectdef.h). It can handle QObject member functions and functors in which
case  "this" is used to select the event loop (like connect() functions).

I've uploaded my change as a draft on gerrit:
https://codereview.qt-project.org/#/c/182339/

Here is the link to the relevant bug report:
https://bugreports.qt.io/browse/QTBUG-37253

I welcome any comment and feedback.

BR,

Benjamin Terrier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20170114/4890467b/attachment.html>


More information about the Development mailing list