Public Member Functions | Protected Member Functions | Friends
QtVariantProperty Class Reference

The QtVariantProperty class is a convenience class handling QVariant based properties. More...

Inheritance diagram for QtVariantProperty:

List of all members.

Public Member Functions

 ~QtVariantProperty ()
QVariant value () const
QVariant attributeValue (const QString &attribute) const
int valueType () const
int propertyType () const
void setValue (const QVariant &value)
void setAttribute (const QString &attribute, const QVariant &value)

Protected Member Functions

 QtVariantProperty (QtVariantPropertyManager *manager)


class QtVariantPropertyManager

Detailed Description

The QtVariantProperty class is a convenience class handling QVariant based properties.

QtVariantProperty provides additional API: A property's type, value type, attribute values and current value can easily be retrieved using the propertyType(), valueType(), attributeValue() and value() functions respectively. In addition, the attribute values and the current value can be set using the corresponding setValue() and setAttribute() functions.

For example, instead of writing:

        QtVariantPropertyManager *variantPropertyManager;
        QtProperty *property;

        variantPropertyManager->setValue(property, 10);

you can write:

        QtVariantPropertyManager *variantPropertyManager;
        QtVariantProperty *property;


QtVariantProperty instances can only be created by the QtVariantPropertyManager class.

See also:
QtProperty, QtVariantPropertyManager, QtVariantEditorFactory

Constructor & Destructor Documentation

Destroys this property.

See also:

Creates a variant property using the given manager.

Do not use this constructor to create variant property instances; use the QtVariantPropertyManager::addProperty() function instead. This constructor is used internally by the QtVariantPropertyManager::createProperty() function.

See also:

Member Function Documentation

QVariant QtVariantProperty::attributeValue ( const QString &  attribute) const

Returns this property's value for the specified attribute.

QtVariantPropertyManager provides a couple of related functions: {QtVariantPropertyManager::attributes()}{attributes()} and {QtVariantPropertyManager::attributeType()}{attributeType()}.

See also:

Returns this property's type.

QtVariantPropertyManager provides several related functions: {QtVariantPropertyManager::enumTypeId()}{enumTypeId()}, {QtVariantPropertyManager::flagTypeId()}{flagTypeId()} and {QtVariantPropertyManager::groupTypeId()}{groupTypeId()}.

See also:
void QtVariantProperty::setAttribute ( const QString &  attribute,
const QVariant &  value 

Sets the attribute of property to value.

QtVariantPropertyManager provides the related {QtVariantPropertyManager::setAttribute()}{setAttribute()} function.

See also:
void QtVariantProperty::setValue ( const QVariant &  value)

Sets the value of this property to value.

The specified value must be of the type returned by valueType(), or of a type that can be converted to valueType() using the QVariant::canConvert() function; otherwise this function does nothing.

See also:
QVariant QtVariantProperty::value ( ) const

Returns the property's current value.

See also:
valueType(), setValue()

Returns the type of this property's value.

See also:

The documentation for this class was generated from the following files:
 All Classes Functions Enumerations Properties