문제
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).
다른 팁
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
.
제휴하지 않습니다 StackOverflow