itom
|
The QtAbstractPropertyManager provides an interface for property managers. More...
Signals | |
void | propertyInserted (QtProperty *property, QtProperty *parent, QtProperty *after) |
void | propertyChanged (QtProperty *property) |
void | propertyRemoved (QtProperty *property, QtProperty *parent) |
void | propertyDestroyed (QtProperty *property) |
Public Member Functions | |
QtAbstractPropertyManager (QObject *parent=0) | |
~QtAbstractPropertyManager () | |
QSet< QtProperty * > | properties () const |
void | clear () const |
QtProperty * | addProperty (const QString &name=QString()) |
Protected Member Functions | |
virtual bool | hasValue (const QtProperty *property) const |
virtual QIcon | valueIcon (const QtProperty *property) const |
virtual QString | valueText (const QtProperty *property) const |
virtual QString | displayText (const QtProperty *property) const |
virtual EchoMode | echoMode (const QtProperty *) const |
virtual void | initializeProperty (QtProperty *property)=0 |
virtual void | uninitializeProperty (QtProperty *property) |
virtual QtProperty * | createProperty () |
Private Attributes | |
QtAbstractPropertyManagerPrivate * | d_ptr |
Friends | |
class | QtProperty |
The QtAbstractPropertyManager provides an interface for property managers.
A manager can create and manage properties of a given type, and is used in conjunction with the QtAbstractPropertyBrowser class.
When using a property browser widget, the properties are created and managed by implementations of the QtAbstractPropertyManager class. To ensure that the properties' values will be displayed using suitable editing widgets, the managers are associated with objects of QtAbstractEditorFactory subclasses. The property browser will use these associations to determine which factories it should use to create the preferred editing widgets.
The QtAbstractPropertyManager class provides common functionality like creating a property using the addProperty() function, and retrieving the properties created by the manager using the properties() function. The class also provides signals that are emitted when the manager's properties change: propertyInserted(), propertyRemoved(), propertyChanged() and propertyDestroyed().
QtAbstractPropertyManager subclasses are supposed to provide their own type specific API. Note that several ready-made implementations are available:
\list \o QtBoolPropertyManager \o QtColorPropertyManager \o QtDatePropertyManager \o QtDateTimePropertyManager \o QtDoublePropertyManager \o QtEnumPropertyManager \o QtFlagPropertyManager \o QtFontPropertyManager \o QtGroupPropertyManager \o QtIntPropertyManager \o QtPointPropertyManager \o QtRectPropertyManager \o QtSizePropertyManager \o QtSizePolicyPropertyManager \o QtStringPropertyManager \o QtTimePropertyManager \o QtVariantPropertyManager \endlist
|
explicit |
Creates an abstract property manager with the given parent.
QtAbstractPropertyManager::~QtAbstractPropertyManager | ( | ) |
Destroys the manager. All properties created by the manager are destroyed.
QtProperty * QtAbstractPropertyManager::addProperty | ( | const QString & | name = QString() | ) |
Creates a property with the given name which then is owned by this manager.
Internally, this function calls the createProperty() and initializeProperty() functions.
void QtAbstractPropertyManager::clear | ( | ) | const |
Destroys all the properties that this manager has created.
|
protectedvirtual |
Creates a property.
The base implementation produce QtProperty instances; Reimplement this function to make this manager produce objects of a QtProperty subclass.
Reimplemented in QtVariantPropertyManager.
|
protectedvirtual |
Returns a string representing the current state of the given property.
The default implementation of this function returns an empty string.
Reimplemented in QtStringPropertyManager.
|
protectedvirtual |
Returns the echo mode representing the current state of the given property.
The default implementation of this function returns QLineEdit::Normal.
Reimplemented in QtStringPropertyManager.
|
protectedvirtual |
Returns whether the given property has a value.
The default implementation of this function returns true.
Reimplemented in QtGroupPropertyManager, and QtVariantPropertyManager.
|
protectedpure virtual |
This function is called whenever a new valid property pointer has been created, passing the pointer as parameter.
The purpose is to let the manager know that the property has been created so that it can provide additional attributes for the new property, e.g. QtIntPropertyManager adds \l {QtIntPropertyManager::value()}{value}, \l {QtIntPropertyManager::minimum()}{minimum} and \l {QtIntPropertyManager::maximum()}{maximum} attributes. Since each manager subclass adds type specific attributes, this function is pure virtual and must be reimplemented when deriving from the QtAbstractPropertyManager class.
Implemented in ito::AbstractParamPropertyManager, ito::ParamCharArrayPropertyManager, ito::ParamCharPropertyManager, ito::ParamDoubleArrayPropertyManager, ito::ParamDoublePropertyManager, ito::ParamIntArrayPropertyManager, ito::ParamIntervalPropertyManager, ito::ParamIntPropertyManager, ito::ParamOtherPropertyManager, ito::ParamRectPropertyManager, ito::ParamStringListPropertyManager, ito::ParamStringPropertyManager, QtBoolPropertyManager, QtCharPropertyManager, QtColorPropertyManager, QtCursorPropertyManager, QtDatePropertyManager, QtDateTimePropertyManager, QtDoublePropertyManager, QtEnumPropertyManager, QtFlagPropertyManager, QtFontPropertyManager, QtGroupPropertyManager, QtIntPropertyManager, QtKeySequencePropertyManager, QtLocalePropertyManager, QtMarginsPropertyManager, QtPointFPropertyManager, QtPointPropertyManager, QtRectFPropertyManager, QtRectPropertyManager, QtSizeFPropertyManager, QtSizePolicyPropertyManager, QtSizePropertyManager, QtStringPropertyManager, QtTimePropertyManager, and QtVariantPropertyManager.
QSet< QtProperty * > QtAbstractPropertyManager::properties | ( | ) | const |
Returns the set of properties created by this manager.
|
signal |
This signal is emitted whenever a property's data changes, passing a pointer to the property as parameter.
Note that signal is only emitted for properties that are created by this manager.
|
signal |
This signal is emitted when the specified property is about to be destroyed.
Note that signal is only emitted for properties that are created by this manager.
|
signal |
This signal is emitted when a new subproperty is inserted into an existing property, passing pointers to the newProperty, parentProperty and precedingProperty as parameters.
If precedingProperty is 0, the newProperty was inserted at the beginning of the parentProperty's subproperties list.
Note that signal is emitted only if the parentProperty is created by this manager.
|
signal |
This signal is emitted when a subproperty is removed, passing pointers to the removed property and the parent property as parameters.
Note that signal is emitted only when the parent property is created by this manager.
|
protectedvirtual |
This function is called just before the specified property is destroyed.
The purpose is to let the property manager know that the property is being destroyed so that it can remove the property's additional attributes.
Reimplemented in ito::AbstractParamPropertyManager, ito::ParamCharArrayPropertyManager, ito::ParamDoubleArrayPropertyManager, ito::ParamIntArrayPropertyManager, ito::ParamRectPropertyManager, ito::ParamStringListPropertyManager, QtBoolPropertyManager, QtCharPropertyManager, QtColorPropertyManager, QtCursorPropertyManager, QtDatePropertyManager, QtDateTimePropertyManager, QtDoublePropertyManager, QtEnumPropertyManager, QtFlagPropertyManager, QtFontPropertyManager, QtGroupPropertyManager, QtIntPropertyManager, QtKeySequencePropertyManager, QtLocalePropertyManager, QtMarginsPropertyManager, QtPointFPropertyManager, QtPointPropertyManager, QtRectFPropertyManager, QtRectPropertyManager, QtSizeFPropertyManager, QtSizePolicyPropertyManager, QtSizePropertyManager, QtStringPropertyManager, QtTimePropertyManager, and QtVariantPropertyManager.
|
protectedvirtual |
Returns an icon representing the current state of the given property.
The default implementation of this function returns an invalid icon.
Reimplemented in ito::AbstractParamPropertyManager, ito::ParamCharPropertyManager, ito::ParamDoublePropertyManager, ito::ParamIntPropertyManager, QtBoolPropertyManager, QtColorPropertyManager, QtCursorPropertyManager, QtEnumPropertyManager, QtFontPropertyManager, and QtVariantPropertyManager.
|
protectedvirtual |
Returns a string representing the current state of the given property.
The default implementation of this function returns an empty string.
Reimplemented in ito::AbstractParamPropertyManager, ito::ParamCharArrayPropertyManager, ito::ParamCharPropertyManager, ito::ParamDoubleArrayPropertyManager, ito::ParamDoublePropertyManager, ito::ParamIntArrayPropertyManager, ito::ParamIntervalPropertyManager, ito::ParamIntPropertyManager, ito::ParamOtherPropertyManager, ito::ParamRectPropertyManager, ito::ParamStringListPropertyManager, ito::ParamStringPropertyManager, QtBoolPropertyManager, QtCharPropertyManager, QtColorPropertyManager, QtCursorPropertyManager, QtDatePropertyManager, QtDateTimePropertyManager, QtDoublePropertyManager, QtEnumPropertyManager, QtFlagPropertyManager, QtFontPropertyManager, QtIntPropertyManager, QtKeySequencePropertyManager, QtLocalePropertyManager, QtMarginsPropertyManager, QtPointFPropertyManager, QtPointPropertyManager, QtRectFPropertyManager, QtRectPropertyManager, QtSizeFPropertyManager, QtSizePolicyPropertyManager, QtSizePropertyManager, QtStringPropertyManager, QtTimePropertyManager, and QtVariantPropertyManager.