Class: QgsProcessingMapLayerComboBox¶
- class qgis.gui.QgsProcessingMapLayerComboBox¶
Bases:
PyQt5.QtWidgets.QWidget
Processing map layer combo box.
Warning
Not part of stable API and may change in future QGIS releases.
New in version 3.8.
QgsProcessingMapLayerComboBox(parameter:
QgsProcessingParameterDefinition
, type: QgsProcessingGui.WidgetType = QgsProcessingGui.Standard, parent: QWidget = None) Constructor forQgsProcessingMapLayerComboBox
, with the specifiedparameter
definition.Methods
Returns the current layer selected in the combobox, or
None
if the selection cannot be represented as a map layer.Returns the current text of the selected item in the combobox.
- param event:
- param event:
- param event:
Returns whether the combo box value can be freely edited.
Sets whether the combo box value can be freely edited.
Sets the combo box to the specified
layer
, iflayer
is compatible with the widget's parameter definition.Sets the
value
shown in the widget.Sets the
context
in which the widget is shown.Returns the current value of the widget.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- currentLayer(self) QgsMapLayer ¶
Returns the current layer selected in the combobox, or
None
if the selection cannot be represented as a map layer.Warning
Prefer calling
value()
instead, as it correctly encapsulates all valid values which can be represented by the widget.See also
- Return type:
- currentText(self) str ¶
Returns the current text of the selected item in the combobox.
Warning
Prefer calling
value()
instead, as it correctly encapsulates all valid values which can be represented by the widget.See also
- Return type:
str
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, event: QDragEnterEvent)¶
- Parameters:
event (QDragEnterEvent) –
- dragLeaveEvent(self, event: QDragLeaveEvent)¶
- Parameters:
event (QDragLeaveEvent) –
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, event: QDropEvent)¶
- Parameters:
event (QDropEvent) –
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isEditable(self) bool ¶
Returns whether the combo box value can be freely edited.
See also
New in version 3.14.
- Return type:
bool
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setEditable(self, editable: bool)¶
Sets whether the combo box value can be freely edited.
See also
New in version 3.14.
- Parameters:
editable (bool) –
- setLayer(self, layer: QgsMapLayer)¶
Sets the combo box to the specified
layer
, iflayer
is compatible with the widget’s parameter definition.- Parameters:
layer (QgsMapLayer) –
- setValue(self, value: Any, context: QgsProcessingContext)¶
Sets the
value
shown in the widget.See also
- Parameters:
value (Any) –
context (QgsProcessingContext) –
- setWidgetContext(self, context: QgsProcessingParameterWidgetContext)¶
Sets the
context
in which the widget is shown.New in version 3.14.
- Parameters:
context (QgsProcessingParameterWidgetContext) –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- value(self) Any ¶
Returns the current value of the widget.
See also
- Return type:
Any
- valueChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- wheelEvent(self, QWheelEvent)¶