missing `invokeMethod` function for `QMetaObject`
https://doc.qt.io/qt-5/qmetaobject.html#invokeMethod
I need to call invokeMethod from a non-GUI thread to trigger an object's slot in the GUI thread. The recommended method seems to be to use that object's meta-object invokeMethod function. However I cannot find this method in the qt_core bindings. What is missing for its implementation?
We're missing support for the QGenericArgument type, which is constructed in C++ using the Q_ARG macro. It's possible to add support for it for a finite set of types, but it hasn't been done yet.
As a workaround, you can use a queued signal-slot connection (see Signals and Slots Across Threads). When using a queued connection, Qt will automatically invoke slots in the receiver's thread. You can use a signal wrapper type provided by rust-qt to create a sender object.
I was aware of using queued connections but I hadn't found the signal wrapper types. That solves my problem, thank you.
I'll leave the issue open in case it is eventually decided to implement invokeMethod.