|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QItemEditorCreatorBase Class Reference
[QtGui module]

The QItemEditorCreatorBase class provides an abstract base class that must be subclassed when implementing new item editor creators. More...

     #include <QItemEditorCreatorBase>

Inherited by QStandardItemEditorCreator.

This class was introduced in Qt 4.2.

- List of all members, including inherited members

### Public Functions

- virtual ~QItemEditorCreatorBase ()
- virtual QWidget * createWidget ( QWidget * parent ) const = 0
- virtual QByteArray valuePropertyName () const = 0

## Detailed Description

The QItemEditorCreatorBase class provides an abstract base class that must be subclassed when implementing new item editor creators.

Item editor creators are specialized widget factories that provide editor widgets for specific types of item data. QItemEditorFactory finds the appropriate factory for editors using a QVariant-based scheme to associate data types with editor creators.

QStandardItemEditorCreator is a convenience template class that can be used to register widgets without the need to subclass QItemEditorCreatorBase.

See also QStandardItemEditorCreator, QItemEditorFactory, and Model/View Programming.

## Member Function Documentation

### QItemEditorCreatorBase::~QItemEditorCreatorBase () `[virtual]`

Destroys the editor creator object.

### QWidget * QItemEditorCreatorBase::createWidget ( QWidget * parent ) const `[pure virtual]`

Returns an editor widget with the given parent.

When implementing this function in subclasses of this class, you must construct and return new editor widgets with the parent widget specified.

### QByteArray QItemEditorCreatorBase::valuePropertyName () const `[pure virtual]`

Returns the name of the property used to get and set values in the creator's editor widgets.

When implementing this function in subclasses, you must ensure that the editor widget's property specified by this function can accept the type the creator is registered for. For example, a creator which constructs QCheckBox widgets to edit boolean values would return the checkable property name from this function, and must be registered in the item editor factory for the QVariant::Bool type.

Note: Since Qt 4.2 the item delegates query the user property of widgets, and only call this function if the widget has no user property. You can override this behavior by reimplementing QAbstractItemDelegate::setModelData() and QAbstractItemDelegate::setEditorData().

See also QMetaObject::userProperty() and QItemEditorFactory::registerEditor().