Question
I would like to write a QML Extension using only Python. I know how to do this in C++, but not in Python. Is this even possible? Here's a vague idea of what I'm looking for.
class NewToQML(QObject):
Q_PROPERTY(int root READ num WRITE setNum NOTIFY numChanged REVISION 1)
And in test.qml:
import MyQmlAdditions 1.0
NewToQML {
num: 7;
}
[edit] I would like to use this QML addition to accomplish for instance changing the cursor when the mouse is over the graphical object (NewToQML).
OTHER TIPS
If you installed the examples and demos with PyQt, the Minehunt demo provides a QML example. If you don't have it installed, download the PyQt4 source and look in examples/demos/declarative/minehunt
.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow