QSapecNG
Public Member Functions | Protected Member Functions | Friends
QtProperty Class Reference

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

Inheritance diagram for QtProperty:
QtVariantProperty

List of all members.

Public Member Functions

virtual ~QtProperty ()
QList< QtProperty * > subProperties () const
QtAbstractPropertyManagerpropertyManager () const
QString toolTip () const
QString statusTip () const
QString whatsThis () const
QString propertyName () const
bool isEnabled () const
bool isModified () const
bool hasValue () const
QIcon valueIcon () const
QString valueText () const
void setToolTip (const QString &text)
void setStatusTip (const QString &text)
void setWhatsThis (const QString &text)
void setPropertyName (const QString &text)
void setEnabled (bool enable)
void setModified (bool modified)
void addSubProperty (QtProperty *property)
void insertSubProperty (QtProperty *property, QtProperty *afterProperty)
void removeSubProperty (QtProperty *property)

Protected Member Functions

 QtProperty (QtAbstractPropertyManager *manager)
void propertyChanged ()

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:

Getter Setter propertyName() setPropertyName() statusTip() setStatusTip() toolTip() setToolTip() whatsThis() setWhatsThis() isEnabled() setEnabled() isModified() setModified() valueText() Nop valueIcon() Nop

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 ( ) [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()
QtProperty::QtProperty ( QtAbstractPropertyManager manager) [explicit, protected]

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

Member Function Documentation

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()
bool QtProperty::hasValue ( ) const

Returns whether the property has a value.

See also:
QtAbstractPropertyManager::hasValue()
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()
bool QtProperty::isEnabled ( ) const

Returns whether the property is enabled.

See also:
setEnabled()
bool QtProperty::isModified ( ) const

Returns whether the property is modified.

See also:
setModified()

Returns a pointer to the manager that owns this property.

QString QtProperty::propertyName ( ) const

Returns the property's name.

See also:
setPropertyName()

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

See also:
addSubProperty(), insertSubProperty()
void QtProperty::setEnabled ( bool  enable)

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

See also:
isEnabled()
void QtProperty::setModified ( bool  modified)

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

See also:
isModified()
void QtProperty::setPropertyName ( const QString &  name)

Sets the property's name to the given name.

See also:
propertyName()
void QtProperty::setStatusTip ( const QString &  text)

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

See also:
statusTip()
void QtProperty::setToolTip ( const QString &  text)

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

See also:
toolTip()
void QtProperty::setWhatsThis ( const QString &  text)

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

See also:
whatsThis()
QString QtProperty::statusTip ( ) const

Returns the property's status tip.

See also:
setStatusTip()
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()
QString QtProperty::toolTip ( ) const

Returns the property's tool tip.

See also:
setToolTip()
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()
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()
QString QtProperty::whatsThis ( ) const

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

See also:
setWhatsThis()

The documentation for this class was generated from the following files:
 All Classes Functions Enumerations Properties