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. | |
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 125 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 110 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 387 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 186 of file qtpropertybrowser.cpp.
bool QtProperty::hasValue | ( | ) | const |
Returns whether the property has a value.
Definition at line 246 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 408 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 226 of file qtpropertybrowser.cpp.
Referenced by QtTreePropertyBrowserPrivate::enableItem().
bool QtProperty::isModified | ( | ) | const |
Returns whether the property is modified.
Definition at line 236 of file qtpropertybrowser.cpp.
Referenced by QtPropertyEditorDelegate::paint().
|
protected |
Definition at line 481 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 155 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 216 of file qtpropertybrowser.cpp.
void QtProperty::removeSubProperty | ( | QtProperty * | property | ) |
Removes the given property from the list of subproperties without deleting it.
Definition at line 458 of file qtpropertybrowser.cpp.
Sets the property description's tool tip to the given text.
Definition at line 298 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 356 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 370 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 342 of file qtpropertybrowser.cpp.
References propertyChanged().
Sets the property's status tip to the given text.
Definition at line 312 of file qtpropertybrowser.cpp.
References propertyChanged().
Definition at line 48 of file qtpropertybrowser_p.h.
References setValueToolTip().
Sets the property value's tool tip to the given text.
Definition at line 283 of file qtpropertybrowser.cpp.
References propertyChanged().
Referenced by setToolTip().
Sets the property's "What's This" help text to the given text.
Definition at line 326 of file qtpropertybrowser.cpp.
References propertyChanged().
QString QtProperty::statusTip | ( | ) | const |
Returns the property's status tip.
Definition at line 196 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 147 of file qtpropertybrowser.cpp.
|
inline |
Definition at line 35 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 259 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 272 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 173 of file qtpropertybrowser.cpp.
Referenced by toolTip().
QString QtProperty::whatsThis | ( | ) | const |
Returns the property's "What's This" help text.
Definition at line 206 of file qtpropertybrowser.cpp.
|
friend |
Definition at line 64 of file qtpropertybrowser_p.h.