Qt for Python UsingQtProperties
Jump to navigation
Jump to search
English 한국어
Using Qt Properties in PySide
PySide provides a
Property
function which allows for declaring properties that simultaneously behave both as Qt and Python properties, and have their setters and getters defined as Python functions.
A short example illustrating defining and accessing a Qt property from Python is given below:
The complete specification for PySide’s property system is given in PSEP 103 [web.archive.org].
Properties in QML expressions
If you are using properties of your objects in QML expressions, QML requires the property to be NOTIFYable. This can be done using a simple signal:
Emit the signal when the data changes, and QML will automatically update all expressions depending on the value.