Creating custom objects on c++ side
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hi! What is the way to create custom objects and passing them to python scripts?
In examples I found PyCustomMetaTypeExample, but I need something like this:
Just try this code, it don't has result too.
In header:
In main.cpp:
In GettingStarted2.py:
Output:
Last edit: Anton 2015-03-18
In you second example, you need to place the methods that should be scriptable into a
public slots:
section. Alternatively, you can add a Q_INVOKABLE macro in front of each method that should be scriptable, but using slots is more common.
Have a closer look at the PythonQt examples, all your questions should be answered by the examples.
Fine! Thank You very much, Florian!