itom
|
The QtVariantProperty class is a convenience class handling QVariant based properties. More...
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) |
Public Member Functions inherited from QtProperty | |
virtual | ~QtProperty () |
QList< QtProperty * > | subProperties () const |
QtAbstractPropertyManager * | propertyManager () const |
QString | toolTip () const |
QString | statusTip () const |
QString | whatsThis () const |
QString | propertyName () const |
bool | isEnabled () const |
bool | isModified () const |
bool | hasValue () const |
QIcon | valueIcon () const |
QString | valueText () const |
QString | displayText () const |
void | setToolTip (const QString &text) |
void | setStatusTip (const QString &text) |
void | setWhatsThis (const QString &text) |
void | setPropertyName (const QString &text) |
void | setEnabled (bool enable) |
void | setModified (bool modified) |
void | addSubProperty (QtProperty *property) |
void | insertSubProperty (QtProperty *property, QtProperty *afterProperty) |
void | removeSubProperty (QtProperty *property) |
Protected Member Functions | |
QtVariantProperty (QtVariantPropertyManager *manager) | |
Protected Member Functions inherited from QtProperty | |
QtProperty (QtAbstractPropertyManager *manager) | |
void | propertyChanged () |
Private Attributes | |
QtVariantPropertyPrivate * | d_ptr |
Friends | |
class | QtVariantPropertyManager |
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:
you can write:
QtVariantProperty instances can only be created by the QtVariantPropertyManager class.
QtVariantProperty::~QtVariantProperty | ( | ) |
Destroys this property.
|
protected |
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.
QVariant QtVariantProperty::attributeValue | ( | const QString & | attribute | ) | const |
Returns this property's value for the specified attribute.
QtVariantPropertyManager provides a couple of related functions: \l{QtVariantPropertyManager::attributes()}{attributes()} and \l{QtVariantPropertyManager::attributeType()}{attributeType()}.
int QtVariantProperty::propertyType | ( | ) | const |
Returns this property's type.
QtVariantPropertyManager provides several related functions: \l{QtVariantPropertyManager::enumTypeId()}{enumTypeId()}, \l{QtVariantPropertyManager::flagTypeId()}{flagTypeId()} and \l{QtVariantPropertyManager::groupTypeId()}{groupTypeId()}.
void QtVariantProperty::setAttribute | ( | const QString & | attribute, |
const QVariant & | value ) |
Sets the attribute of property to value.
QtVariantPropertyManager provides the related \l{QtVariantPropertyManager::setAttribute()}{setAttribute()} function.
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.
QVariant QtVariantProperty::value | ( | ) | const |
Returns the property's current value.
int QtVariantProperty::valueType | ( | ) | const |
Returns the type of this property's value.