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
Emitted whenever the value is changed in the widget.
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: 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], 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¶
Emitted whenever the value is changed in the widget. [signal]
- wheelEvent(self, QWheelEvent)¶