Subgroup: Editor
Class: QgsEditorWidgetRegistry¶
-
class
qgis.gui.
QgsEditorWidgetRegistry
¶ Bases:
PyQt5.QtCore.QObject
This class manages all known edit widget factories.
QgsEditorWidgetRegistry is not usually directly created, but rather accessed through
QgsGui.editorWidgetRegistry()
Methods
blockSignals
childEvent
children
connectNotify
create
Create an attribute editor widget wrapper of a given type for a given field. createConfigWidget
Creates a configuration widget createSearchWidget
customEvent
deleteLater
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
factories
Get access to all registered factories factory
Get a factory for the given widget type id. findBest
Find the best editor widget and its configuration for a given field. findChild
findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] inherits
initEditors
Registers all the default widgets. installEventFilter
isSignalConnected
isWidgetType
isWindowType
killTimer
metaObject
moveToThread
name
Get the human readable name for a widget type objectName
parent
property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. receivers
registerAutoConfPlugin
Register a new auto-conf plugin. registerWidget
Register a new widget factory with the given id removeEventFilter
sender
senderSignalIndex
setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
tr
Attributes
destroyed
destroyed(self, QObject = None) [signal] objectNameChanged
objectNameChanged(self, str) [signal] staticMetaObject
-
childEvent
()¶
-
connectNotify
()¶
-
create
(self, widgetId: str, vl: QgsVectorLayer, fieldIdx: int, config: Dict[str, Any], editor: QWidget, parent: QWidget) → QgsEditorWidgetWrapper¶ Create an attribute editor widget wrapper of a given type for a given field. The editor may be NULL if you want the widget wrapper to create a default widget.
Parameters: - widgetId – The id of the widget type to create an attribute editor for
- vl – The vector layer for which this widget will be created
- fieldIdx – The field index on the specified layer for which this widget will be created
- config – A configuration which should be used for the widget creation
- editor – An editor widget which will be used instead of an autocreated widget
- parent – The parent which will be used for the created wrapper and the created widget
- context – The editor context (not available in Python bindings)
Returns: A new widget wrapper
create(self, vl: QgsVectorLayer, fieldIdx: int, editor: QWidget, parent: QWidget) -> QgsEditorWidgetWrapper Create an attribute editor widget wrapper of the best type for a given field. The editor may be NULL if you want the widget wrapper to create a default widget.
Parameters: - vl – The vector layer for which this widget will be created
- fieldIdx – The field index on the specified layer for which this widget will be created
- editor – An editor widget which will be used instead of an autocreated widget
- parent – The parent which will be used for the created wrapper and the created widget
- context – The editor context (not available in Python bindings)
Returns: A new widget wrapper
-
createConfigWidget
(self, widgetId: str, vl: QgsVectorLayer, fieldIdx: int, parent: QWidget) → QgsEditorConfigWidget¶ Creates a configuration widget
Parameters: - widgetId – The id of the widget type to create a configuration widget for
- vl – The vector layer for which this widget will be created
- fieldIdx – The field index on the specified layer for which this widget will be created
- parent – The parent widget for the created widget
Returns: A new configuration widget
-
createSearchWidget
(self, widgetId: str, vl: QgsVectorLayer, fieldIdx: int, config: Dict[str, Any], parent: QWidget) → QgsSearchWidgetWrapper¶
-
customEvent
()¶
-
disconnectNotify
()¶
-
factories
(self) → object¶ Get access to all registered factories
Returns: All ids and factories
-
factory
(self, widgetId: str) → QgsEditorWidgetFactory¶ Get a factory for the given widget type id.
Returns: A factory or Null if not existent
-
findBest
(self, vl: QgsVectorLayer, fieldName: str) → QgsEditorWidgetSetup¶ Find the best editor widget and its configuration for a given field.
Parameters: - vl – The vector layer for which this widget will be created
- fieldName – The field name on the specified layer for which this widget will be created
Returns: The id of the widget type to use and its config
-
initEditors
(self, mapCanvas: QgsMapCanvas = None, messageBar: QgsMessageBar = None)¶ Registers all the default widgets. Only call this once on startup of an application.
Parameters: - mapCanvas – Specify a map canvas with which the widgets (relation reference) work
- messageBar – Specify a message bar on which messages by widgets will be shown while working with the map canvas
New in version 2.8.
Note
Not required for plugins, the QGIS application does that already
-
isSignalConnected
()¶
-
name
(self, widgetId: str) → str¶ Get the human readable name for a widget type
Parameters: widgetId – The widget type to get the name for Returns: A human readable name
-
receivers
()¶
-
registerAutoConfPlugin
(self, plugin: QgsEditorWidgetAutoConfPlugin)¶ Register a new auto-conf plugin.
Parameters: plugin – The plugin (ownership is transferred)
-
registerWidget
(self, widgetId: str, widgetFactory: QgsEditorWidgetFactory) → bool¶ Register a new widget factory with the given id
Parameters: - widgetId – The id which will be used later to refer to this widget type
- widgetFactory – The factory which will create this widget type
Returns: true, if successful, false, if the widgetId is already in use or widgetFactory is NULL
-
sender
()¶
-
senderSignalIndex
()¶
-
timerEvent
()¶
-