|
The QtProperty class encapsulates an instance of a property. More...
#include <ArmarXGui/libraries/qtpropertybrowser/src/qtpropertybrowser.h>
Public Member Functions | |
void | addSubProperty (QtProperty *property) |
QString | displayText () const |
bool | hasValue () const |
void | insertSubProperty (QtProperty *property, QtProperty *afterProperty) |
bool | isEnabled () const |
bool | isModified () const |
QtAbstractPropertyManager * | propertyManager () const |
QString | propertyName () const |
void | removeSubProperty (QtProperty *property) |
void | setEnabled (bool enable) |
void | setModified (bool modified) |
void | setPropertyName (const QString &text) |
void | setStatusTip (const QString &text) |
void | setToolTip (const QString &text) |
void | setWhatsThis (const QString &text) |
QString | statusTip () const |
QList< QtProperty * > | subProperties () const |
QString | toolTip () const |
QIcon | valueIcon () const |
QString | valueText () const |
QString | whatsThis () const |
virtual | ~QtProperty () |
Protected Member Functions | |
void | propertyChanged () |
QtProperty (QtAbstractPropertyManager *manager) | |
Friends | |
class | QtAbstractPropertyManager |
The QtProperty class encapsulates an instance of a property.
Properties are created by objects of QtAbstractPropertyManager subclasses; a manager can create properties of a given type, and is used in conjunction with the QtAbstractPropertyBrowser class. A property is always owned by the manager that created it, which can be retrieved using the propertyManager() function.
QtProperty contains the most common property attributes, and provides functions for retrieving as well as setting their values:
\table \header \o Getter \o Setter \row \o propertyName() \o setPropertyName() \row \o statusTip() \o setStatusTip() \row \o toolTip() \o setToolTip() \row \o whatsThis() \o setWhatsThis() \row \o isEnabled() \o setEnabled() \row \o isModified() \o setModified() \row \o valueText() \o Nop \row \o valueIcon() \o Nop \endtable
It is also possible to nest properties: QtProperty provides the addSubProperty(), insertSubProperty() and removeSubProperty() functions to manipulate the set of subproperties. Use the subProperties() function to retrieve a property's current set of subproperties. Note that nested properties are not owned by the parent property, i.e. each subproperty is owned by the manager that created it.
Definition at line 71 of file qtpropertybrowser.h.
|
virtual |
Destroys this property.
Note that subproperties are detached but not destroyed, i.e. they can still be used in another context.
Definition at line 160 of file qtpropertybrowser.cpp.
|
explicitprotected |
Creates a property with the given manager.
This constructor is only useful when creating a custom QtProperty subclass (e.g. QtVariantProperty). To create a regular QtProperty object, use the QtAbstractPropertyManager::addProperty() function instead.
Definition at line 145 of file qtpropertybrowser.cpp.
void addSubProperty | ( | QtProperty * | property | ) |
Appends the given property to this property's subproperties.
If the given property already is added, this function does nothing.
Definition at line 427 of file qtpropertybrowser.cpp.
QString displayText | ( | ) | const |
Returns the display text according to the echo-mode set on the editor.
When the editor is a QLineEdit, this will return a string equal to what is displayed.
Definition at line 316 of file qtpropertybrowser.cpp.
bool hasValue | ( | ) | const |
Returns whether the property has a value.
Definition at line 277 of file qtpropertybrowser.cpp.
void insertSubProperty | ( | QtProperty * | property, |
QtProperty * | precedingProperty | ||
) |
Inserts the given property after the specified precedingProperty into this property's list of subproperties. If precedingProperty is 0, the specified property is inserted at the beginning of the list.
If the given property already is inserted, this function does nothing.
Definition at line 452 of file qtpropertybrowser.cpp.
bool isEnabled | ( | ) | const |
Returns whether the property is enabled.
Definition at line 257 of file qtpropertybrowser.cpp.
bool isModified | ( | ) | const |
Returns whether the property is modified.
Definition at line 267 of file qtpropertybrowser.cpp.
|
protected |
Definition at line 553 of file qtpropertybrowser.cpp.
QtAbstractPropertyManager * propertyManager | ( | ) | const |
Returns a pointer to the manager that owns this property.
Definition at line 207 of file qtpropertybrowser.cpp.
QString propertyName | ( | ) | const |
Returns the property's name.
Definition at line 247 of file qtpropertybrowser.cpp.
void removeSubProperty | ( | QtProperty * | property | ) |
Removes the given property from the list of subproperties without deleting it.
Definition at line 524 of file qtpropertybrowser.cpp.
void setEnabled | ( | bool | enable | ) |
Enables or disables the property according to the passed enable value.
Definition at line 392 of file qtpropertybrowser.cpp.
void setModified | ( | bool | modified | ) |
Sets the property's modified state according to the passed modified value.
Definition at line 408 of file qtpropertybrowser.cpp.
void setPropertyName | ( | const QString & | name | ) |
Sets the property's name to the given name.
Definition at line 376 of file qtpropertybrowser.cpp.
void setStatusTip | ( | const QString & | text | ) |
Sets the property's status tip to the given text.
Definition at line 342 of file qtpropertybrowser.cpp.
void setToolTip | ( | const QString & | text | ) |
Sets the property's tool tip to the given text.
Definition at line 326 of file qtpropertybrowser.cpp.
void setWhatsThis | ( | const QString & | text | ) |
Sets the property's "What's This" help text to the given text.
Definition at line 358 of file qtpropertybrowser.cpp.
QString statusTip | ( | ) | const |
Returns the property's status tip.
Definition at line 227 of file qtpropertybrowser.cpp.
QList< QtProperty * > subProperties | ( | ) | const |
Returns the set of subproperties.
Note that subproperties are not owned by this property, but by the manager that created them.
Definition at line 199 of file qtpropertybrowser.cpp.
QString toolTip | ( | ) | const |
Returns the property's tool tip.
Definition at line 217 of file qtpropertybrowser.cpp.
QIcon valueIcon | ( | ) | const |
Returns an icon representing the current state of this property.
If the given property type can not generate such an icon, this function returns an invalid icon.
Definition at line 290 of file qtpropertybrowser.cpp.
QString valueText | ( | ) | const |
Returns a string representing the current state of this property.
If the given property type can not generate such a string, this function returns an empty string.
Definition at line 303 of file qtpropertybrowser.cpp.
QString whatsThis | ( | ) | const |
Returns the property's "What's This" help text.
Definition at line 237 of file qtpropertybrowser.cpp.
|
friend |
Definition at line 106 of file qtpropertybrowser.h.