Generate invoke_* for nullary methods
This generates invoke_*
associated functions on the Emitter struct for methods in bindings.json
. When calling them, QMetaObject::invokMethod
is called for that object, using the default auto
connection type. This provide a way to dispatch onto the QObject's thread from a Rust-based background thread or async task, which comes up pretty often.
A better implementation would allow arguments to be passed as well; this one is limited to 0-argument methods for simplicity. In all of my current use cases, the data I need to pass back to the UI doesn't cleanly fit into the simple types currently supported as method args, so it wouldn't have been useful.