![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QItemEditorFactory class provides widgets for editing item data in views and delegates. More...
#include <qitemeditorfactory.h>
Public Member Functions | |
QItemEditorFactory () | |
Constructs a new item editor factory. | |
virtual | ~QItemEditorFactory () |
Destroys the item editor factory. | |
virtual QWidget * | createEditor (int userType, QWidget *parent) const |
Creates an editor widget with the given parent for the specified userType of data, and returns it as a QWidget. | |
virtual QByteArray | valuePropertyName (int userType) const |
Returns the property name used to access data for the given userType of data. | |
void | registerEditor (int userType, QItemEditorCreatorBase *creator) |
Registers an item editor creator specified by creator for the given userType of data. | |
Static Public Member Functions | |
static const QItemEditorFactory * | defaultFactory () |
Returns the default item editor factory. | |
static void | setDefaultFactory (QItemEditorFactory *factory) |
[2] | |
The QItemEditorFactory class provides widgets for editing item data in views and delegates.
\inmodule QtWidgets
When editing data in an item view, editors are created and displayed by a delegate. QStyledItemDelegate, which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a new default factory with setDefaultFactory(), the new factory will be used by existing and new delegates.
A factory keeps a collection of QItemEditorCreatorBase instances, which are specialized editors that produce editors for one particular QVariant data type (All Qt models store their data in \l{QVariant}s).
Definition at line 59 of file qitemeditorfactory.h.
|
inline |
Constructs a new item editor factory.
Definition at line 62 of file qitemeditorfactory.h.
|
virtual |
Destroys the item editor factory.
Definition at line 163 of file qitemeditorfactory.cpp.
Creates an editor widget with the given parent for the specified userType of data, and returns it as a QWidget.
Reimplemented in QDefaultItemEditorFactory, and QDefaultItemEditorFactory.
Definition at line 137 of file qitemeditorfactory.cpp.
|
static |
Returns the default item editor factory.
Definition at line 313 of file qitemeditorfactory.cpp.
void QItemEditorFactory::registerEditor | ( | int | userType, |
QItemEditorCreatorBase * | creator ) |
Registers an item editor creator specified by creator for the given userType of data.
{Note:} The factory takes ownership of the item editor creator and will destroy it if a new creator for the same type is registered later.
Definition at line 181 of file qitemeditorfactory.cpp.
|
static |
[2]
Sets the default item editor factory to the given factory.
Both new and existing delegates will use the new factory.
Definition at line 327 of file qitemeditorfactory.cpp.
|
virtual |
Returns the property name used to access data for the given userType of data.
Reimplemented in QDefaultItemEditorFactory, and QDefaultItemEditorFactory.
Definition at line 150 of file qitemeditorfactory.cpp.