QMetaProperty Class Reference |
QMetaEnum | enumerator () const |
bool | hasNotifySignal () const |
bool | isConstant () const |
bool | isDesignable ( const QObject * object = 0 ) const |
bool | isEnumType () const |
bool | isFinal () const |
bool | isFlagType () const |
bool | isReadable () const |
bool | isResettable () const |
bool | isScriptable ( const QObject * object = 0 ) const |
bool | isStored ( const QObject * object = 0 ) const |
bool | isUser ( const QObject * object = 0 ) const |
bool | isValid () const |
bool | isWritable () const |
const char * | name () const |
QMetaMethod | notifySignal () const |
int | notifySignalIndex () const |
int | propertyIndex () const |
QVariant | read ( const QObject * object ) const |
bool | reset ( QObject * object ) const |
QVariant::Type | type () const |
const char * | typeName () const |
int | userType () const |
bool | write ( QObject * object, const QVariant & value ) const |
The 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 name() and a type(), as well as various attributes that specify its behavior: isReadable(), isWritable(), isDesignable(), isScriptable(), and isStored().
If the property is an enumeration, 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), isEnumType() and isFlagType() both return true. The enumerator for these types is available from enumerator().
The property's values are set and retrieved with read(), write(), and reset(); they can also be changed through QObject's set and get functions. See QObject::setProperty() and QObject::property() for details.
QMetaProperty objects can be copied by value. However, each copy will refer to the same underlying property meta-data.
See also QMetaObject, QMetaEnum, QMetaMethod, and Qt's Property System.
Returns the enumerator if this property's type is an enumerator type; otherwise the returned value is undefined.
See also isEnumType() and isFlagType().
Returns true if this property has a corresponding change notify signal; otherwise returns false.
See also notifySignal().
Returns true if the property is constant; otherwise returns false.
A property is constant if the Q_PROPERTY()'s CONSTANT attribute is set.
This function was introduced in Qt 4.6.
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).
See also isScriptable() and isStored().
Returns true if the property's type is an enumeration value; otherwise returns false.
See also enumerator() and isFlagType().
Returns true if the property is final; otherwise returns false.
A property is final if the Q_PROPERTY()'s FINAL attribute is set.
This function was introduced in Qt 4.6.
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.
See also isEnumType(), enumerator(), and QMetaEnum::isFlag().
Returns true if this property is readable; otherwise returns false.
See also isWritable(), read(), and isValid().
Returns true if this property can be reset to a default value; otherwise returns false.
See also reset().
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).
See also isDesignable() and isStored().
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).
See also isDesignable() and isScriptable().
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 QLineEdit.
If object is null, the function returns false if the Q_PROPERTY()'s USER attribute is false. Otherwise it returns true.
See also QMetaObject::userProperty(), isDesignable(), and isScriptable().
Returns true if this property is valid (readable); otherwise returns false.
See also isReadable().
Returns true if this property is writable; otherwise returns false.
See also isReadable() and write().
Returns this property's name.
See also type() and typeName().
Returns the QMetaMethod instance of the property change notifying signal if one was specified, otherwise returns an invalid QMetaMethod.
This function was introduced in Qt 4.5.
See also hasNotifySignal().
Returns the index of the property change notifying signal if one was specified, otherwise returns -1.
This function was introduced in Qt 4.6.
See also hasNotifySignal().
Returns this property's index.
This function was introduced in Qt 4.6.
Reads the property's value from the given object. Returns the value if it was able to read it; otherwise returns an invalid variant.
See also write(), reset(), and isReadable().
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.
Returns this property's type. The return value is one of the values of the QVariant::Type enumeration.
See also userType(), typeName(), and name().
Returns the name of this property's type.
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.
This function was introduced in Qt 4.2.
See also type(), QMetaType, and typeName().
Writes value as the property's value to the given object. Returns true if the write succeeded; otherwise returns false.
See also read(), reset(), and isWritable().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com