The PySide.QtCore.QMetaProperty class provides meta-data about a property.
Property meta-data is obtained from an object’s meta-object. See QMetaObject.property() and QMetaObject.propertyCount() for details.
A property has a PySide.QtCore.QMetaProperty.name() and a PySide.QtCore.QMetaProperty.type() , as well as various attributes that specify its behavior: PySide.QtCore.QMetaProperty.isReadable() , PySide.QtCore.QMetaProperty.isWritable() , PySide.QtCore.QMetaProperty.isDesignable() , PySide.QtCore.QMetaProperty.isScriptable() , and PySide.QtCore.QMetaProperty.isStored() .
If the property is an enumeration, PySide.QtCore.QMetaProperty.isEnumType() returns true; if the property is an enumeration that is also a flag (i.e. its values can be combined using the OR operator), PySide.QtCore.QMetaProperty.isEnumType() and PySide.QtCore.QMetaProperty.isFlagType() both return true. The enumerator for these types is available from PySide.QtCore.QMetaProperty.enumerator() .
The property’s values are set and retrieved with PySide.QtCore.QMetaProperty.read() , PySide.QtCore.QMetaProperty.write() , and PySide.QtCore.QMetaProperty.reset() ; they can also be changed through PySide.QtCore.QObject ‘s set and get functions. See QObject.setProperty() and QObject.property() for details.
PySide.QtCore.QMetaProperty objects can be copied by value. However, each copy will refer to the same underlying property meta-data.
See also
PySide.QtCore.QMetaObject PySide.QtCore.QMetaEnum PySide.QtCore.QMetaMethod Qt’s Property System
Parameters: | QMetaProperty – PySide.QtCore.QMetaProperty |
---|
Return type: | PySide.QtCore.QMetaEnum |
---|
Returns the enumerator if this property’s type is an enumerator type; otherwise the returned value is undefined.
Return type: | PySide.QtCore.bool |
---|
Returns true if this property has a corresponding change notify signal; otherwise returns false.
Return type: | PySide.QtCore.bool |
---|
Returns true if the property has a C++ setter function that follows Qt’s standard “name” / “setName” pattern. Designer and uic query PySide.QtCore.QMetaProperty.hasStdCppSet() in order to avoid expensive QObject.setProperty() calls. All properties in Qt [should] follow this pattern.
Return type: | PySide.QtCore.bool |
---|
Returns true if the property is constant; otherwise returns false.
A property is constant if the Q_PROPERTY() ‘s CONSTANT attribute is set.
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if this property is designable for the given object ; otherwise returns false.
If no object is given, the function returns false if the Q_PROPERTY() ‘s DESIGNABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if the property is editable for the given object ; otherwise returns false.
If no object is given, the function returns false if the Q_PROPERTY() ‘s EDITABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).
Return type: | PySide.QtCore.bool |
---|
Returns true if the property’s type is an enumeration value; otherwise returns false.
Return type: | PySide.QtCore.bool |
---|
Returns true if the property is final; otherwise returns false.
A property is final if the Q_PROPERTY() ‘s FINAL attribute is set.
Return type: | PySide.QtCore.bool |
---|
Returns true if the property’s type is an enumeration value that is used as a flag; otherwise returns false.
Flags can be combined using the OR operator. A flag type is implicitly also an enum type.
Return type: | PySide.QtCore.bool |
---|
Returns true if this property is readable; otherwise returns false.
Return type: | PySide.QtCore.bool |
---|
Returns true if this property can be reset to a default value; otherwise returns false.
See also
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if the property is scriptable for the given object ; otherwise returns false.
If no object is given, the function returns false if the Q_PROPERTY() ‘s SCRIPTABLE attribute is false; otherwise returns true (if the attribute is true or is a function or expression).
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if the property is stored for object ; otherwise returns false.
If no object is given, the function returns false if the Q_PROPERTY() ‘s STORED attribute is false; otherwise returns true (if the attribute is true or is a function or expression).
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if this property is designated as the USER property, i.e., the one that the user can edit for object or that is significant in some other way. Otherwise it returns false. e.g., the text property is the USER editable property of a PySide.QtGui.QLineEdit .
If object is null, the function returns false if the Q_PROPERTY() ‘s USER attribute is false. Otherwise it returns true.
Return type: | PySide.QtCore.bool |
---|
Returns true if this property is valid (readable); otherwise returns false.
Return type: | PySide.QtCore.bool |
---|
Returns true if this property is writable; otherwise returns false.
Return type: | str |
---|
Returns this property’s name.
Return type: | PySide.QtCore.QMetaMethod |
---|
Returns the PySide.QtCore.QMetaMethod instance of the property change notifying signal if one was specified, otherwise returns an invalid PySide.QtCore.QMetaMethod .
Return type: | PySide.QtCore.int |
---|
Returns the index of the property change notifying signal if one was specified, otherwise returns -1.
Return type: | PySide.QtCore.int |
---|
Returns this property’s index.
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | object |
Reads the property’s value from the given object . Returns the value if it was able to read it; otherwise returns an invalid variant.
Parameters: | obj – PySide.QtCore.QObject |
---|---|
Return type: | PySide.QtCore.bool |
Resets the property for the given object with a reset method. Returns true if the reset worked; otherwise returns false.
Reset methods are optional; only a few properties support them.
Return type: | PySide.QtCore.QVariant::Type |
---|
Returns this property’s type. The return value is one of the values of the QVariant.Type enumeration.
Return type: | str |
---|
Returns the name of this property’s type.
Return type: | PySide.QtCore.int |
---|
Returns this property’s user type. The return value is one of the values that are registered with QMetaType , or 0 if the type is not registered.
See also
PySide.QtCore.QMetaProperty.type() QMetaType PySide.QtCore.QMetaProperty.typeName()
Parameters: |
|
---|---|
Return type: | PySide.QtCore.bool |
Writes value as the property’s value to the given object . Returns true if the write succeeded; otherwise returns false.