QMetaProperty

概要

函数

详细描述

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() 了解细节。

Property Meta-Data

A property has a PySide.QtCore.QMetaProperty.name() 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() ,和 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() ,和 PySide.QtCore.QMetaProperty.reset() ; they can also be changed through PySide.QtCore.QObject ‘s set and get functions. See QObject.setProperty() and QObject.property() 了解细节。

Copying and Assignment

PySide.QtCore.QMetaProperty objects can be copied by value. However, each copy will refer to the same underlying property meta-data.

class PySide.QtCore. QMetaProperty
class PySide.QtCore. QMetaProperty ( QMetaProperty )
参数: QMetaProperty PySide.QtCore.QMetaProperty
PySide.QtCore.QMetaProperty. enumerator ( )
返回类型: PySide.QtCore.QMetaEnum

Returns the enumerator if this property's type is an enumerator type; otherwise the returned value is undefined.

PySide.QtCore.QMetaProperty. hasNotifySignal ( )
返回类型: PySide.QtCore.bool

Returns true if this property has a corresponding change notify signal; otherwise returns false.

PySide.QtCore.QMetaProperty. hasStdCppSet ( )
返回类型: 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.

PySide.QtCore.QMetaProperty. isConstant ( )
返回类型: 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.

PySide.QtCore.QMetaProperty. isDesignable ( [ obj=None ] )
参数: obj PySide.QtCore.QObject
返回类型: PySide.QtCore.bool

Returns true if this property is designable for the given object ;否则返回 false。

若无 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).

PySide.QtCore.QMetaProperty. isEditable ( [ obj=None ] )
参数: obj PySide.QtCore.QObject
返回类型: PySide.QtCore.bool

Returns true if the property is editable for the given object ;否则返回 false。

若无 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).

PySide.QtCore.QMetaProperty. isEnumType ( )
返回类型: PySide.QtCore.bool

Returns true if the property's type is an enumeration value; otherwise returns false.

PySide.QtCore.QMetaProperty. isFinal ( )
返回类型: 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.

PySide.QtCore.QMetaProperty. isFlagType ( )
返回类型: 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.

PySide.QtCore.QMetaProperty. isReadable ( )
返回类型: PySide.QtCore.bool

Returns true if this property is readable; otherwise returns false.

PySide.QtCore.QMetaProperty. isResettable ( )
返回类型: PySide.QtCore.bool

Returns true if this property can be reset to a default value; otherwise returns false.

PySide.QtCore.QMetaProperty. isScriptable ( [ obj=None ] )
参数: obj PySide.QtCore.QObject
返回类型: PySide.QtCore.bool

Returns true if the property is scriptable for the given object ;否则返回 false。

若无 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).

PySide.QtCore.QMetaProperty. isStored ( [ obj=None ] )
参数: obj PySide.QtCore.QObject
返回类型: PySide.QtCore.bool

Returns true if the property is stored for object ;否则返回 false。

若无 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).

PySide.QtCore.QMetaProperty. isUser ( [ obj=None ] )
参数: obj PySide.QtCore.QObject
返回类型: 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 .

object is null, the function returns false if the Q_PROPERTY() ‘s USER attribute is false. Otherwise it returns true.

PySide.QtCore.QMetaProperty. isValid ( )
返回类型: PySide.QtCore.bool

Returns true if this property is valid (readable); otherwise returns false.

PySide.QtCore.QMetaProperty. isWritable ( )
返回类型: PySide.QtCore.bool

Returns true if this property is writable; otherwise returns false.

PySide.QtCore.QMetaProperty. name ( )
返回类型: str

Returns this property's name.

PySide.QtCore.QMetaProperty. notifySignal ( )
返回类型: PySide.QtCore.QMetaMethod

返回 PySide.QtCore.QMetaMethod instance of the property change notifying signal if one was specified, otherwise returns an invalid PySide.QtCore.QMetaMethod .

PySide.QtCore.QMetaProperty. notifySignalIndex ( )
返回类型: PySide.QtCore.int

Returns the index of the property change notifying signal if one was specified, otherwise returns -1.

PySide.QtCore.QMetaProperty. propertyIndex ( )
返回类型: PySide.QtCore.int

Returns this property's index.

PySide.QtCore.QMetaProperty. read ( obj )
参数: obj PySide.QtCore.QObject
返回类型: 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.

PySide.QtCore.QMetaProperty. reset ( obj )
参数: obj PySide.QtCore.QObject
返回类型: 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.

PySide.QtCore.QMetaProperty. revision ( )
返回类型: PySide.QtCore.int

Returns the property revision if one was specified by REVISION, otherwise returns 0.

PySide.QtCore.QMetaProperty. type ( )
返回类型: PySide.QtCore.QVariant::Type

Returns this property's type. The return value is one of the values of the QVariant.Type enumeration.

PySide.QtCore.QMetaProperty. typeName ( )
返回类型: str

Returns the name of this property's type.

PySide.QtCore.QMetaProperty. userType ( )
返回类型: 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.

PySide.QtCore.QMetaProperty. write ( obj , value )
参数:
返回类型:

PySide.QtCore.bool

写入 value as the property's value to the given object . Returns true if the write succeeded; otherwise returns false.