![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QtProperty class encapsulates an instance of a property. More...
#include <qtpropertybrowser_p.h>
Public Member Functions | |
virtual | ~QtProperty () |
Destroys this property. | |
QList< QtProperty * > | subProperties () const |
Returns the set of subproperties. | |
QtProperty * | parentProperty () const |
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 | |
QtProperty (QtAbstractPropertyManager *manager) | |
Creates a property with the given manager. | |
void | propertyChanged () |
Friends | |
class | QtAbstractPropertyManager |
The QtProperty class encapsulates an instance of a property.
\inmodule QtDesigner
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
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.
\inmodule QtDesigner
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
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 26 of file qtpropertybrowser_p.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 126 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 111 of file qtpropertybrowser.cpp.
References QtProperty().
Referenced by QtProperty(), and QtAbstractPropertyManager::createProperty().
void QtProperty::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 394 of file qtpropertybrowser.cpp.
References insertSubProperty().
Referenced by qdesigner_internal::BrushPropertyManager::initializeProperty(), QtColorPropertyManager::initializeProperty(), QtFontPropertyManager::initializeProperty(), QtLocalePropertyManager::initializeProperty(), QtPointFPropertyManager::initializeProperty(), QtPointPropertyManager::initializeProperty(), QtRectFPropertyManager::initializeProperty(), QtRectPropertyManager::initializeProperty(), QtSizeFPropertyManager::initializeProperty(), QtSizePolicyPropertyManager::initializeProperty(), QtSizePropertyManager::initializeProperty(), and qdesigner_internal::FontPropertyManager::postInitializeProperty().
QString QtProperty::descriptionToolTip | ( | ) | const |
Returns the property description's tool tip.
This is suitable for tool tips over the description (label).
Definition at line 193 of file qtpropertybrowser.cpp.
bool QtProperty::hasValue | ( | ) | const |
Returns whether the property has a value.
Definition at line 253 of file qtpropertybrowser.cpp.
Referenced by QtPropertyEditorView::drawRow(), QtTreePropertyBrowserPrivate::hasValue(), QtPropertyEditorDelegate::paint(), and QtButtonPropertyBrowserPrivate::propertyInserted().
void QtProperty::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 415 of file qtpropertybrowser.cpp.
Referenced by addSubProperty(), QtVariantPropertyManagerPrivate::createSubProperty(), and qdesigner_internal::PropertyEditor::setObject().
bool QtProperty::isEnabled | ( | ) | const |
Returns whether the property is enabled.
Definition at line 233 of file qtpropertybrowser.cpp.
Referenced by QtTreePropertyBrowserPrivate::enableItem().
bool QtProperty::isModified | ( | ) | const |
Returns whether the property is modified.
Definition at line 243 of file qtpropertybrowser.cpp.
Referenced by QtPropertyEditorDelegate::paint().
QtProperty * QtProperty::parentProperty | ( | ) | const |
Definition at line 154 of file qtpropertybrowser.cpp.
Referenced by qdesigner_internal::FontPropertyManager::resetFontSubProperty().
|
protected |
Definition at line 489 of file qtpropertybrowser.cpp.
Referenced by setDescriptionToolTip(), setEnabled(), setModified(), setPropertyName(), setStatusTip(), setValueToolTip(), and setWhatsThis().
QtAbstractPropertyManager * QtProperty::propertyManager | ( | ) | const |
Returns a pointer to the manager that owns this property.
Definition at line 162 of file qtpropertybrowser.cpp.
Referenced by QtVariantPropertyManager::attributeValue(), QtAbstractPropertyBrowser::createEditor(), QtVariantPropertyManagerPrivate::internalPropertyToType(), QtAbstractEditorFactory< PropertyManager >::propertyManager(), QtVariantPropertyManager::setAttribute(), QtVariantPropertyManager::setValue(), and QtVariantPropertyManager::value().
QString QtProperty::propertyName | ( | ) | const |
Returns the property's name.
Definition at line 223 of file qtpropertybrowser.cpp.
void QtProperty::removeSubProperty | ( | QtProperty * | property | ) |
Removes the given property from the list of subproperties without deleting it.
Definition at line 466 of file qtpropertybrowser.cpp.
Sets the property description's tool tip to the given text.
Definition at line 305 of file qtpropertybrowser.cpp.
References propertyChanged().
void QtProperty::setEnabled | ( | bool | enable | ) |
Enables or disables the property according to the passed enable value.
Definition at line 363 of file qtpropertybrowser.cpp.
References propertyChanged().
void QtProperty::setModified | ( | bool | modified | ) |
Sets the property's modified state according to the passed modified value.
Definition at line 377 of file qtpropertybrowser.cpp.
References propertyChanged().
Referenced by qdesigner_internal::PropertyEditor::setObject(), and qdesigner_internal::PropertyEditor::setPropertyValue().
Sets the property's name to the given name.
Definition at line 349 of file qtpropertybrowser.cpp.
References propertyChanged().
Sets the property's status tip to the given text.
Definition at line 319 of file qtpropertybrowser.cpp.
References propertyChanged().
Definition at line 49 of file qtpropertybrowser_p.h.
Sets the property value's tool tip to the given text.
Definition at line 290 of file qtpropertybrowser.cpp.
References propertyChanged().
Sets the property's "What's This" help text to the given text.
Definition at line 333 of file qtpropertybrowser.cpp.
References propertyChanged().
QString QtProperty::statusTip | ( | ) | const |
Returns the property's status tip.
Definition at line 203 of file qtpropertybrowser.cpp.
QList< QtProperty * > 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 149 of file qtpropertybrowser.cpp.
|
inline |
Definition at line 36 of file qtpropertybrowser_p.h.
References valueToolTip().
QIcon QtProperty::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 266 of file qtpropertybrowser.cpp.
QString QtProperty::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 279 of file qtpropertybrowser.cpp.
QString QtProperty::valueToolTip | ( | ) | const |
Returns the property value's tool tip.
This is suitable for tool tips over the value (item delegate).
Definition at line 180 of file qtpropertybrowser.cpp.
Referenced by toolTip().
QString QtProperty::whatsThis | ( | ) | const |
Returns the property's "What's This" help text.
Definition at line 213 of file qtpropertybrowser.cpp.
|
friend |
Definition at line 65 of file qtpropertybrowser_p.h.