Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QtVariantProperty class is a convenience class handling QVariant based properties. More...
#include <qtvariantproperty_p.h>
Public Member Functions | |
~QtVariantProperty () | |
Destroys this property. | |
QVariant | value () const |
Returns the property's current value. | |
QVariant | attributeValue (const QString &attribute) const |
Returns this property's value for the specified attribute. | |
int | valueType () const |
Returns the type of this property's value. | |
int | propertyType () const |
Returns this property's type. | |
void | setValue (const QVariant &value) |
Sets the value of this property to value. | |
void | setAttribute (const QString &attribute, const QVariant &value) |
Sets the attribute of property to value. | |
Public Member Functions inherited from QtProperty | |
virtual | ~QtProperty () |
Destroys this property. | |
QList< QtProperty * > | subProperties () const |
Returns the set of subproperties. | |
QtAbstractPropertyManager * | propertyManager () const |
Returns a pointer to the manager that owns this property. | |
QString | toolTip () const |
QString | valueToolTip () const |
Returns the property value's tool tip. | |
QString | descriptionToolTip () const |
Returns the property description's tool tip. | |
QString | statusTip () const |
Returns the property's status tip. | |
QString | whatsThis () const |
Returns the property's "What's This" help text. | |
QString | propertyName () const |
Returns the property's name. | |
bool | isEnabled () const |
Returns whether the property is enabled. | |
bool | isModified () const |
Returns whether the property is modified. | |
bool | hasValue () const |
Returns whether the property has a value. | |
QIcon | valueIcon () const |
Returns an icon representing the current state of this property. | |
QString | valueText () const |
Returns a string representing the current state of this property. | |
void | setToolTip (const QString &text) |
void | setValueToolTip (const QString &text) |
Sets the property value's tool tip to the given text. | |
void | setDescriptionToolTip (const QString &text) |
Sets the property description's tool tip to the given text. | |
void | setStatusTip (const QString &text) |
Sets the property's status tip to the given text. | |
void | setWhatsThis (const QString &text) |
Sets the property's "What's This" help text to the given text. | |
void | setPropertyName (const QString &text) |
Sets the property's name to the given name. | |
void | setEnabled (bool enable) |
Enables or disables the property according to the passed enable value. | |
void | setModified (bool modified) |
Sets the property's modified state according to the passed modified value. | |
void | addSubProperty (QtProperty *property) |
Appends the given property to this property's subproperties. | |
void | insertSubProperty (QtProperty *property, QtProperty *afterProperty) |
Inserts the given property after the specified precedingProperty into this property's list of subproperties. | |
void | removeSubProperty (QtProperty *property) |
Removes the given property from the list of subproperties without deleting it. | |
Protected Member Functions | |
QtVariantProperty (QtVariantPropertyManager *manager) | |
Creates a variant property using the given manager. | |
Protected Member Functions inherited from QtProperty | |
QtProperty (QtAbstractPropertyManager *manager) | |
Creates a property with the given manager. | |
void | propertyChanged () |
Friends | |
class | QtVariantPropertyManager |
The QtVariantProperty class is a convenience class handling QVariant based properties.
\inmodule QtDesigner
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.
Definition at line 28 of file qtvariantproperty_p.h.
QtVariantProperty::~QtVariantProperty | ( | ) |
Destroys this property.
Definition at line 168 of file qtvariantproperty.cpp.
|
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.
Definition at line 158 of file qtvariantproperty.cpp.
References QtVariantProperty().
Referenced by QtVariantProperty(), and QtVariantPropertyManager::createProperty().
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()}.
Definition at line 191 of file qtvariantproperty.cpp.
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()}.
Definition at line 216 of file qtvariantproperty.cpp.
Referenced by qdesigner_internal::PropertyEditor::setObject().
Sets the attribute of property to value.
QtVariantPropertyManager provides the related \l{QtVariantPropertyManager::setAttribute()}{setAttribute()} function.
Definition at line 245 of file qtvariantproperty.cpp.
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.
Definition at line 231 of file qtvariantproperty.cpp.
QVariant QtVariantProperty::value | ( | ) | const |
Returns the property's current value.
Definition at line 177 of file qtvariantproperty.cpp.
int QtVariantProperty::valueType | ( | ) | const |
Returns the type of this property's value.
Definition at line 201 of file qtvariantproperty.cpp.
|
friend |
Definition at line 42 of file qtvariantproperty_p.h.