Exposing functions/slots at global scope
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hello guys,
right now I can register a Qt class with the python context as:
What I do not like is that I have use "helper." every time:
It'd be great if there was a way of defining a class whose methods were "globally exposed" in the pythonqt terminal. Something like this:
as it'd declared static, you are able to call the method directly:
Last edit: Andrea Tagliasacchi 2013-10-03
PythonQt does not support this out of the box, but you can add your object with a special name, e.g. helper and then use the PythonQt introspection call to get all member names. The you can add them via addVariable(name, getVariable("helper." + name)).