PythonQt.QtGui.QItemEditorFactory
QItemEditorFactory
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
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 QVariants).
Standard Editing Widgets
The standard factory implementation provides editors for a variety of data types. These are created whenever a delegate needs to provide an editor for data supplied by a model. The following table shows the relationship between types and the standard editors provided.
| Type | Editor Widget |
|---|---|
| bool | QComboBox |
| double | QDoubleSpinBox |
| int | QSpinBox |
| unsigned int | |
| QDate | QDateEdit |
| QDateTime | QDateTimeEdit |
| QPixmap | QLabel |
| QString | QLineEdit |
| QTime | QTimeEdit |
Additional editors can be registered with the registerEditor() function.
Source: https://doc.qt.io/archives/qt-5.15/qitemeditorfactory.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
createEditor |
function | (self, userType: int, parent: Any) -> Any |
X.createEditor(userType, parent) -> PythonQt.QtGui.QWidget |
defaultFactory |
function | (self) -> Any |
X.defaultFactory() -> PythonQt.QtGui.QItemEditorFactory |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
registerEditor |
function | (self, userType: int, creator: Any) -> None |
X.registerEditor(userType, creator) |
setDefaultFactory |
function | (self, factory: Any) -> None |
Sets the default item editor factory to the given factory. |
valuePropertyName |
function | (self, userType: int) -> Any |
X.valuePropertyName(userType) -> PythonQt.QtCore.QByteArray |