The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase. More...
#include <QStandardItemEditorCreator>
Inherits: QItemEditorCreatorBase.
This class was introduced in Qt 4.2.
QStandardItemEditorCreator () |
virtual QWidget * | createWidget ( QWidget * parent ) const |
virtual QByteArray | valuePropertyName () const |
The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase.
This convenience template class makes it possible to register widgets without having to subclass QItemEditorCreatorBase.
Example:
QItemEditorFactory *editorFactory = new QItemEditorFactory; QItemEditorCreatorBase *creator = new QStandardItemEditorCreator<MyFancyDateTimeEdit>(); editorFactory->registerEditor(QVariant::DateType, creator);
Setting the editorFactory created above in an item delegate via QItemDelegate::setItemEditorFactory() makes sure that all values of type QVariant::DateTime will be edited in MyFancyDateTimeEdit.
The editor must provide a user property that will contain the editing data. The property is used by QItemDelegates to set and retrieve the data (using Qt's meta-object system). You set the user property with the USER keyword:
Q_PROPERTY(QColor color READ color WRITE setColor USER true)
See also QItemEditorCreatorBase, QItemEditorCreator, QItemEditorFactory, QItemDelegate, and Color Editor Factory Example.
Constructs an editor creator object.
Reimplemented from QItemEditorCreatorBase::createWidget().
Reimplemented from QItemEditorCreatorBase::valuePropertyName().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.