Logo Search packages:      
Sourcecode: qsapecng version File versions  Download package

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends

QtAbstractEditorFactory< PropertyManager > Class Template Reference

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

Inheritance diagram for QtAbstractEditorFactory< PropertyManager >:
Inheritance graph
[legend]
Collaboration diagram for QtAbstractEditorFactory< PropertyManager >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void addPropertyManager (PropertyManager *manager)
QWidget * createEditor (QtProperty *property, QWidget *parent)
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)

Private Member Functions

void breakConnection (QtAbstractPropertyManager *manager)

Private Attributes

QSet< PropertyManager * > m_managers

Friends

class QtAbstractPropertyBrowser
class QtAbstractPropertyEditor

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:

        QtSpinBoxFactory *factory;
        QSet<QtIntPropertyManager *> managers = factory->propertyManagers();

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:

QtCheckBoxFactory QtDateEditFactory QtDateTimeEditFactory QtDoubleSpinBoxFactory QtEnumEditorFactory QtLineEditFactory QtScrollBarFactory QtSliderFactory QtSpinBoxFactory QtTimeEditFactory 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

Definition at line 208 of file qtpropertybrowser.h.


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

Generated by  Doxygen 1.6.0   Back to index