QItemEditorCreator Class

The QItemEditorCreator class makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase. More...

Header: #include <QItemEditorCreator>
qmake: QT += widgets
Since: Qt 4.2
Inherits: QItemEditorCreatorBase

Public Functions

QItemEditorCreator(const QByteArray &valuePropertyName)

Reimplemented Public Functions

virtual QWidget *createWidget(QWidget *parent) const
virtual QByteArray valuePropertyName() const

Detailed Description

The QItemEditorCreator class makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase.

QItemEditorCreator is a convenience template class. It uses the template class to create editors for QItemEditorFactory. This way, it is not necessary to subclass QItemEditorCreatorBase.


  QItemEditorCreator<MyEditor> *itemCreator =
      new QItemEditorCreator<MyEditor>("myProperty");

  QItemEditorFactory *factory = new QItemEditorFactory;

The constructor takes the name of the property that contains the editing data. QItemDelegate can then access the property by name when it sets and retrieves editing data. Only use this class if your editor does not define a user property (using the USER keyword in the Q_PROPERTY macro). If the widget has a user property, you should use QStandardItemEditorCreator instead.

See also QItemEditorCreatorBase, QStandardItemEditorCreator, QItemEditorFactory, and Color Editor Factory Example.

Member Function Documentation

QItemEditorCreator::QItemEditorCreator(const QByteArray &valuePropertyName)

Default constructs an instance of QItemEditorCreator.

[virtual] QWidget *QItemEditorCreator::createWidget(QWidget *parent) const

[virtual] QByteArray QItemEditorCreator::valuePropertyName() const