Computer Assisted Medical Intervention Tool Kit  version 5.2
QtProperty Class Reference

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

#include <qtpropertybrowser.h>

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

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

Detailed Description

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.

See also
QtAbstractPropertyManager, QtBrowserItem

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

References QtPropertyPrivate::m_manager, QtPropertyPrivate::m_parentItems, QtPropertyPrivate::m_subItems, QtAbstractPropertyManagerPrivate::propertyDestroyed(), and QtAbstractPropertyManagerPrivate::propertyRemoved().

+ Here is the call graph for this function:

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

References QtPropertyPrivate::q_ptr.

Member Function Documentation

◆ addSubProperty()

void QtProperty::addSubProperty ( QtProperty property)

◆ displayText()

QString QtProperty::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.

See also
QtAbstractPropertyManager::valueText()

References QtAbstractPropertyManager::displayText(), and QtPropertyPrivate::m_manager.

Referenced by QtVariantPropertyManager::valueText().

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

◆ hasValue()

bool QtProperty::hasValue ( ) const

Returns whether the property has a value.

See also
QtAbstractPropertyManager::hasValue()

References QtAbstractPropertyManager::hasValue(), and QtPropertyPrivate::m_manager.

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

+ Here is the call graph for this function:
+ 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()

References QtPropertyPrivate::m_manager, QtPropertyPrivate::m_subItems, QtAbstractPropertyManagerPrivate::propertyInserted(), and subProperties().

Referenced by addSubProperty(), and QtVariantPropertyManagerPrivate::createSubProperty().

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

◆ isEnabled()

bool QtProperty::isEnabled ( ) const

Returns whether the property is enabled.

See also
setEnabled()

References QtPropertyPrivate::m_enabled.

◆ isModified()

bool QtProperty::isModified ( ) const

Returns whether the property is modified.

See also
setModified()

References QtPropertyPrivate::m_modified.

◆ propertyChanged()

void QtProperty::propertyChanged ( )
protected

References QtPropertyPrivate::m_manager, and QtAbstractPropertyManagerPrivate::propertyChanged().

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

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

◆ propertyManager()

QtAbstractPropertyManager * QtProperty::propertyManager ( ) const

Returns a pointer to the manager that owns this property.

References QtPropertyPrivate::m_manager.

Referenced by QtVariantPropertyManager::attributeValue(), QtAbstractEditorFactory< PropertyManager >::createEditor(), 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()

References QtPropertyPrivate::m_name.

Referenced by QtCursorEditorFactory::createEditor().

+ Here is the caller graph for this function:

◆ removeSubProperty()

void QtProperty::removeSubProperty ( QtProperty property)

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

See also
addSubProperty(), insertSubProperty()

References QtPropertyPrivate::m_manager, QtPropertyPrivate::m_subItems, QtAbstractPropertyManagerPrivate::propertyRemoved(), and subProperties().

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

References QtPropertyPrivate::m_enabled, and propertyChanged().

Referenced by ObjectControllerPrivate::addClassProperties(), and camitk::ObjectControllerPrivate::buildQtVariantProperty().

+ Here is the call graph for this function:
+ Here is the caller 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()

References QtPropertyPrivate::m_modified, and propertyChanged().

+ Here is the call graph for this function:

◆ setPropertyName()

void QtProperty::setPropertyName ( const QString &  name)

◆ setStatusTip()

void QtProperty::setStatusTip ( const QString &  text)

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

See also
statusTip()

References QtPropertyPrivate::m_statusTip, and propertyChanged().

Referenced by camitk::ObjectControllerPrivate::addDynamicProperties(), and QtVariantPropertyManagerPrivate::createSubProperty().

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

◆ setToolTip()

void QtProperty::setToolTip ( const QString &  text)

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

See also
toolTip()

References QtPropertyPrivate::m_toolTip, and propertyChanged().

Referenced by camitk::ObjectControllerPrivate::addDynamicProperties(), and QtVariantPropertyManagerPrivate::createSubProperty().

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

References QtPropertyPrivate::m_whatsThis, and propertyChanged().

Referenced by camitk::ObjectControllerPrivate::addDynamicProperties(), and QtVariantPropertyManagerPrivate::createSubProperty().

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

◆ statusTip()

QString QtProperty::statusTip ( ) const

Returns the property's status tip.

See also
setStatusTip()

References QtPropertyPrivate::m_statusTip.

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

References QtPropertyPrivate::m_subItems.

Referenced by QtVariantPropertyManager::initializeProperty(), insertSubProperty(), and removeSubProperty().

+ Here is the caller graph for this function:

◆ toolTip()

QString QtProperty::toolTip ( ) const

Returns the property's tool tip.

See also
setToolTip()

References QtPropertyPrivate::m_toolTip.

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

References QtPropertyPrivate::m_manager, and QtAbstractPropertyManager::valueIcon().

Referenced by QtVariantPropertyManager::valueIcon().

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

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

References QtPropertyPrivate::m_manager, and QtAbstractPropertyManager::valueText().

Referenced by QtVariantPropertyManager::valueText().

+ Here is the call graph for this function:
+ 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()

References QtPropertyPrivate::m_whatsThis.

Friends And Related Function Documentation

◆ QtAbstractPropertyManager

friend class QtAbstractPropertyManager
friend

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