Computer Assisted Medical Intervention Tool Kit  version 5.2
QtAbstractEditorFactory< PropertyManager > Class Template Referenceabstract

The QtAbstractEditorFactory is the base template class for editor factories. More...

#include <qtpropertybrowser.h>

+ Inheritance diagram for QtAbstractEditorFactory< PropertyManager >:
+ Collaboration diagram for QtAbstractEditorFactory< PropertyManager >:

Public Member Functions

void addPropertyManager (PropertyManager *manager)
 
QWidget * createEditor (QtProperty *property, QWidget *parent) override
 
PropertyManager * propertyManager (QtProperty *property) const
 
QSet< PropertyManager * > propertyManagers () const
 
 QtAbstractEditorFactory (QObject *parent)
 
void removePropertyManager (PropertyManager *manager)
 

Protected Member Functions

virtual void connectPropertyManager (PropertyManager *manager)=0
 
virtual QWidget * createEditor (PropertyManager *manager, QtProperty *property, QWidget *parent)=0
 
virtual void disconnectPropertyManager (PropertyManager *manager)=0
 
void managerDestroyed (QObject *manager) override
 
- Protected Member Functions inherited from QtAbstractEditorFactoryBase
 QtAbstractEditorFactoryBase (QObject *parent=nullptr)
 

Friends

class QtAbstractPropertyEditor
 

Additional Inherited Members

- Protected Slots inherited from QtAbstractEditorFactoryBase

Detailed Description

template<class PropertyManager>
class QtAbstractEditorFactory< PropertyManager >

The QtAbstractEditorFactory is the base template class for editor factories.

An editor factory is a class that is able to create an editing widget of a specified type (e.g. line edits or comboboxes) for a given QtProperty object, and it is used in conjunction with the QtAbstractPropertyManager and QtAbstractPropertyBrowser classes.

Note that the QtAbstractEditorFactory functions are using the PropertyManager template argument class which can be any QtAbstractPropertyManager subclass. For example:

QSet<QtIntPropertyManager *> managers = factory->propertyManagers();
QSet< PropertyManager * > propertyManagers() const
Definition: qtpropertybrowser.h:238
The description of this class will come soon !
Definition: qteditorfactory.h:61

Note that QtSpinBoxFactory by definition creates editing widgets only for properties created by QtIntPropertyManager.

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.

A QtAbstractEditorFactory object is capable of producing editors for several property managers at the same time. To create an association between this factory and a given manager, use the addPropertyManager() function. Use the removePropertyManager() function to make this factory stop producing editors for a given property manager. Use the propertyManagers() function to retrieve the set of managers currently associated with this factory.

Several ready-made implementations of the QtAbstractEditorFactory class are available:

  1. QtCheckBoxFactory
  2. QtDateEditFactory
  3. QtDateTimeEditFactory
  4. QtDoubleSpinBoxFactory
  5. QtEnumEditorFactory
  6. QtLineEditFactory
  7. QtScrollBarFactory
  8. QtSliderFactory
  9. QtSpinBoxFactory
  10. QtTimeEditFactory
  11. QtVariantEditorFactory

When deriving from the QtAbstractEditorFactory class, several pure virtual functions must be implemented: the connectPropertyManager() function is used by the factory to connect to the given manager's signals, the createEditor() function is supposed to create an editor for the given property controlled by the given manager, and finally the disconnectPropertyManager() function is used by the factory to disconnect from the specified manager's signals.

See also
QtAbstractEditorFactoryBase, QtAbstractPropertyManager

Constructor & Destructor Documentation

◆ QtAbstractEditorFactory()

template<class PropertyManager >
QtAbstractEditorFactory< PropertyManager >::QtAbstractEditorFactory ( QObject *  parent = 0)
inlineexplicit

Creates an editor factory with the given parent.

See also
addPropertyManager()

Member Function Documentation

◆ addPropertyManager()

template<class PropertyManager >
void QtAbstractEditorFactory< PropertyManager >::addPropertyManager ( PropertyManager *  manager)
inline

Adds the given manager to this factory's set of managers, making this factory produce editing widgets for properties created by the given manager.

The PropertyManager type is a template argument class, and represents the chosen QtAbstractPropertyManager subclass.

See also
propertyManagers(), removePropertyManager()

References QtAbstractEditorFactory< PropertyManager >::connectPropertyManager(), and QtAbstractEditorFactory< PropertyManager >::managerDestroyed().

Referenced by DecoratedDoubleSpinBoxFactory::connectPropertyManager(), QtVariantEditorFactory::connectPropertyManager(), QtCursorEditorFactory::QtCursorEditorFactory(), and QtAbstractPropertyBrowser::setFactoryForManager().

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

◆ connectPropertyManager()

template<class PropertyManager >
void QtAbstractEditorFactory< PropertyManager >::connectPropertyManager ( PropertyManager *  manager)
protectedpure virtual

Connects this factory to the given manager's signals. The PropertyManager type is a template argument class, and represents the chosen QtAbstractPropertyManager subclass.

This function is used internally by the addPropertyManager() function, and makes it possible to update an editing widget when the associated property's data changes. This is typically done in custom slots responding to the signals emitted by the property's manager, e.g. QtIntPropertyManager::valueChanged() and QtIntPropertyManager::rangeChanged().

See also
propertyManagers(), disconnectPropertyManager()

Referenced by QtAbstractEditorFactory< PropertyManager >::addPropertyManager().

+ Here is the caller graph for this function:

◆ createEditor() [1/2]

template<class PropertyManager >
QWidget * QtAbstractEditorFactory< PropertyManager >::createEditor ( PropertyManager *  manager,
QtProperty property,
QWidget *  parent 
)
protectedpure virtual

Creates an editing widget with the given parent for the specified property created by the given manager. The PropertyManager type is a template argument class, and represents the chosen QtAbstractPropertyManager subclass.

This function must be implemented in derived classes: It is recommended to store a pointer to the widget and map it to the given property, since the widget must be updated whenever the associated property's data changes. This is typically done in custom slots responding to the signals emitted by the property's manager, e.g. QtIntPropertyManager::valueChanged() and QtIntPropertyManager::rangeChanged().

See also
connectPropertyManager()

◆ createEditor() [2/2]

template<class PropertyManager >
QWidget * QtAbstractEditorFactory< PropertyManager >::createEditor ( QtProperty property,
QWidget *  parent 
)
inlineoverridevirtual

Creates an editing widget (with the given parent) for the given property.

Implements QtAbstractEditorFactoryBase.

References QtProperty::propertyManager().

+ Here is the call graph for this function:

◆ disconnectPropertyManager()

template<class PropertyManager >
void QtAbstractEditorFactory< PropertyManager >::disconnectPropertyManager ( PropertyManager *  manager)
protectedpure virtual

Disconnects this factory from the given manager's signals. The PropertyManager type is a template argument class, and represents the chosen QtAbstractPropertyManager subclass.

This function is used internally by the removePropertyManager() function.

See also
propertyManagers(), connectPropertyManager()

Referenced by QtAbstractEditorFactory< PropertyManager >::removePropertyManager().

+ Here is the caller graph for this function:

◆ managerDestroyed()

template<class PropertyManager >
void QtAbstractEditorFactory< PropertyManager >::managerDestroyed ( QObject *  manager)
inlineoverrideprotectedvirtual

Implements QtAbstractEditorFactoryBase.

Referenced by QtAbstractEditorFactory< PropertyManager >::addPropertyManager(), and QtAbstractEditorFactory< PropertyManager >::removePropertyManager().

+ Here is the caller graph for this function:

◆ propertyManager()

template<class PropertyManager >
PropertyManager * QtAbstractEditorFactory< PropertyManager >::propertyManager ( QtProperty property) const
inline

Returns the property manager for the given property, or 0 if the given property doesn't belong to any of this factory's registered managers.

The PropertyManager type is a template argument class, and represents the chosen QtAbstractPropertyManager subclass.

See also
propertyManagers()

Referenced by QtDoubleSpinBoxFactoryPrivate::slotDecimalsChanged(), QtLineEditFactoryPrivate::slotEchoModeChanged(), QtCursorEditorFactoryPrivate::slotEnumChanged(), QtEnumEditorFactoryPrivate::slotEnumIconsChanged(), QtEnumEditorFactoryPrivate::slotEnumNamesChanged(), QtDateEditFactoryPrivate::slotRangeChanged(), QtDoubleSpinBoxFactoryPrivate::slotRangeChanged(), QtSpinBoxFactoryPrivate::slotRangeChanged(), QtSliderFactoryPrivate::slotRangeChanged(), QtScrollBarFactoryPrivate::slotRangeChanged(), QtLineEditFactoryPrivate::slotRegExpChanged(), QtCheckBoxFactoryPrivate::slotSetValue(), QtCharEditorFactoryPrivate::slotSetValue(), QtColorEditorFactoryPrivate::slotSetValue(), QtDateEditFactoryPrivate::slotSetValue(), QtDateTimeEditFactoryPrivate::slotSetValue(), QtFontEditorFactoryPrivate::slotSetValue(), QtKeySequenceEditorFactoryPrivate::slotSetValue(), QtLineEditFactoryPrivate::slotSetValue(), QtTimeEditFactoryPrivate::slotSetValue(), QtDoubleSpinBoxFactoryPrivate::slotSetValue(), QtSpinBoxFactoryPrivate::slotSetValue(), QtSliderFactoryPrivate::slotSetValue(), QtScrollBarFactoryPrivate::slotSetValue(), QtEnumEditorFactoryPrivate::slotSetValue(), and QtDoubleSpinBoxFactoryPrivate::slotSingleStepChanged().

+ Here is the caller graph for this function:

◆ propertyManagers()

template<class PropertyManager >
QSet< PropertyManager * > QtAbstractEditorFactory< PropertyManager >::propertyManagers ( ) const
inline

Returns the factory's set of associated managers. The PropertyManager type is a template argument class, and represents the chosen QtAbstractPropertyManager subclass.

See also
addPropertyManager(), removePropertyManager()

◆ removePropertyManager()

template<class PropertyManager >
void QtAbstractEditorFactory< PropertyManager >::removePropertyManager ( PropertyManager *  manager)
inline

Removes the given manager from this factory's set of managers. The PropertyManager type is a template argument class, and may be any QtAbstractPropertyManager subclass.

See also
propertyManagers(), addPropertyManager()

References QtAbstractEditorFactory< PropertyManager >::disconnectPropertyManager(), and QtAbstractEditorFactory< PropertyManager >::managerDestroyed().

Referenced by DecoratedDoubleSpinBoxFactory::disconnectPropertyManager(), and QtVariantEditorFactory::disconnectPropertyManager().

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

Friends And Related Function Documentation

◆ QtAbstractPropertyEditor

template<class PropertyManager >
friend class QtAbstractPropertyEditor
friend

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