Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtProperty Class Reference

The QtProperty class encapsulates an instance of a property. More...

#include <qtpropertybrowser_p.h>

+ Inheritance diagram for QtProperty:
+ Collaboration diagram for QtProperty:

Public Member Functions

virtual ~QtProperty ()
 Destroys this property.
 
QList< QtProperty * > subProperties () const
 Returns the set of subproperties.
 
QtAbstractPropertyManagerpropertyManager () 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
 

Detailed Description

The QtProperty class encapsulates an instance of a property.

\inmodule QtDesigner

Since
4.4

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.

See also
QtAbstractPropertyManager, QtBrowserItem

\inmodule QtDesigner

Since
4.4

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.

See also
QtAbstractPropertyManager, QtBrowserItem

Definition at line 26 of file qtpropertybrowser_p.h.

Constructor & Destructor Documentation

◆ ~QtProperty()

QtProperty::~QtProperty ( )
virtual

Destroys this property.

Note that subproperties are detached but not destroyed, i.e. they can still be used in another context.

See also
QtAbstractPropertyManager::clear()

Definition at line 125 of file qtpropertybrowser.cpp.

◆ QtProperty()

QtProperty::QtProperty ( QtAbstractPropertyManager * manager)
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.

See also
QtAbstractPropertyManager::addProperty()

Definition at line 110 of file qtpropertybrowser.cpp.

References QtProperty().

Referenced by QtProperty(), and QtAbstractPropertyManager::createProperty().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ addSubProperty()

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.

See also
insertSubProperty(), removeSubProperty()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ descriptionToolTip()

QString QtProperty::descriptionToolTip ( ) const

Returns the property description's tool tip.

This is suitable for tool tips over the description (label).

Since
5.6
See also
setDescriptionToolTip()

Definition at line 186 of file qtpropertybrowser.cpp.

◆ hasValue()

bool QtProperty::hasValue ( ) const

Returns whether the property has a value.

See also
QtAbstractPropertyManager::hasValue()

Definition at line 246 of file qtpropertybrowser.cpp.

Referenced by QtPropertyEditorView::drawRow(), QtTreePropertyBrowserPrivate::hasValue(), QtPropertyEditorDelegate::paint(), and QtButtonPropertyBrowserPrivate::propertyInserted().

+ Here is the caller graph for this function:

◆ insertSubProperty()

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.

See also
addSubProperty(), removeSubProperty()

Definition at line 408 of file qtpropertybrowser.cpp.

Referenced by addSubProperty(), QtVariantPropertyManagerPrivate::createSubProperty(), and qdesigner_internal::PropertyEditor::setObject().

+ Here is the caller graph for this function:

◆ isEnabled()

bool QtProperty::isEnabled ( ) const

Returns whether the property is enabled.

See also
setEnabled()

Definition at line 226 of file qtpropertybrowser.cpp.

Referenced by QtTreePropertyBrowserPrivate::enableItem().

+ Here is the caller graph for this function:

◆ isModified()

bool QtProperty::isModified ( ) const

Returns whether the property is modified.

See also
setModified()

Definition at line 236 of file qtpropertybrowser.cpp.

Referenced by QtPropertyEditorDelegate::paint().

+ Here is the caller graph for this function:

◆ propertyChanged()

void QtProperty::propertyChanged ( )
protected

Definition at line 481 of file qtpropertybrowser.cpp.

Referenced by setDescriptionToolTip(), setEnabled(), setModified(), setPropertyName(), setStatusTip(), setValueToolTip(), and setWhatsThis().

+ Here is the caller graph for this function:

◆ propertyManager()

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().

+ Here is the caller graph for this function:

◆ propertyName()

QString QtProperty::propertyName ( ) const

Returns the property's name.

See also
setPropertyName()

Definition at line 216 of file qtpropertybrowser.cpp.

◆ removeSubProperty()

void QtProperty::removeSubProperty ( QtProperty * property)

Removes the given property from the list of subproperties without deleting it.

See also
addSubProperty(), insertSubProperty()

Definition at line 458 of file qtpropertybrowser.cpp.

◆ setDescriptionToolTip()

void QtProperty::setDescriptionToolTip ( const QString & text)

Sets the property description's tool tip to the given text.

Since
5.6
See also
descriptionToolTip()

Definition at line 298 of file qtpropertybrowser.cpp.

References propertyChanged().

+ Here is the call graph for this function:

◆ setEnabled()

void QtProperty::setEnabled ( bool enable)

Enables or disables the property according to the passed enable value.

See also
isEnabled()

Definition at line 356 of file qtpropertybrowser.cpp.

References propertyChanged().

+ Here is the call graph for this function:

◆ setModified()

void QtProperty::setModified ( bool modified)

Sets the property's modified state according to the passed modified value.

See also
isModified()

Definition at line 370 of file qtpropertybrowser.cpp.

References propertyChanged().

Referenced by qdesigner_internal::PropertyEditor::setObject(), and qdesigner_internal::PropertyEditor::setPropertyValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPropertyName()

void QtProperty::setPropertyName ( const QString & name)

Sets the property's name to the given name.

See also
propertyName()

Definition at line 342 of file qtpropertybrowser.cpp.

References propertyChanged().

+ Here is the call graph for this function:

◆ setStatusTip()

void QtProperty::setStatusTip ( const QString & text)

Sets the property's status tip to the given text.

See also
statusTip()

Definition at line 312 of file qtpropertybrowser.cpp.

References propertyChanged().

+ Here is the call graph for this function:

◆ setToolTip()

void QtProperty::setToolTip ( const QString & text)
inline

Definition at line 48 of file qtpropertybrowser_p.h.

References setValueToolTip().

+ Here is the call graph for this function:

◆ setValueToolTip()

void QtProperty::setValueToolTip ( const QString & text)

Sets the property value's tool tip to the given text.

Since
5.6
See also
valueToolTip()

Definition at line 283 of file qtpropertybrowser.cpp.

References propertyChanged().

Referenced by setToolTip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWhatsThis()

void QtProperty::setWhatsThis ( const QString & text)

Sets the property's "What's This" help text to the given text.

See also
whatsThis()

Definition at line 326 of file qtpropertybrowser.cpp.

References propertyChanged().

+ Here is the call graph for this function:

◆ statusTip()

QString QtProperty::statusTip ( ) const

Returns the property's status tip.

See also
setStatusTip()

Definition at line 196 of file qtpropertybrowser.cpp.

◆ subProperties()

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.

See also
insertSubProperty(), removeSubProperty()

Definition at line 147 of file qtpropertybrowser.cpp.

◆ toolTip()

QString QtProperty::toolTip ( ) const
inline

Definition at line 35 of file qtpropertybrowser_p.h.

References valueToolTip().

+ Here is the call graph for this function:

◆ valueIcon()

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.

See also
QtAbstractPropertyManager::valueIcon()

Definition at line 259 of file qtpropertybrowser.cpp.

◆ valueText()

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.

See also
QtAbstractPropertyManager::valueText()

Definition at line 272 of file qtpropertybrowser.cpp.

◆ valueToolTip()

QString QtProperty::valueToolTip ( ) const

Returns the property value's tool tip.

This is suitable for tool tips over the value (item delegate).

Since
5.6
See also
setValueToolTip()

Definition at line 173 of file qtpropertybrowser.cpp.

Referenced by toolTip().

+ Here is the caller graph for this function:

◆ whatsThis()

QString QtProperty::whatsThis ( ) const

Returns the property's "What's This" help text.

See also
setWhatsThis()

Definition at line 206 of file qtpropertybrowser.cpp.

Friends And Related Symbol Documentation

◆ QtAbstractPropertyManager

friend class QtAbstractPropertyManager
friend

Definition at line 64 of file qtpropertybrowser_p.h.


The documentation for this class was generated from the following files: