Class: QgsProcessingMapLayerComboBox

class qgis.gui.QgsProcessingMapLayerComboBox(parameter: QgsProcessingParameterDefinition, type: QgsProcessingGui.WidgetType = QgsProcessingGui.Standard, parent: QWidget = None)

Bases: PyQt5.QtWidgets.QWidget

Constructor for QgsProcessingMapLayerComboBox, with the specified parameter definition.

Processing map layer combo box.

Warning

Not part of stable API and may change in future QGIS releases.

New in version 3.8.

Parameters
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

currentText()

Return type

QgsMapLayer

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

currentLayer()

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

setEditable()

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

isEditable()

New in version 3.14.

Parameters

editable (bool) –

setLayer(self, layer: QgsMapLayer)

Sets the combo box to the specified layer, if layer 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

value()

Parameters
setWidgetContext(self, context: QgsProcessingParameterWidgetContext)

Sets the context in which the widget is shown.

New in version 3.14.

Parameters

context (QgsProcessingParameterWidgetContext) –

sharedPainter(self) → QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
value(self) → Any

Returns the current value of the widget.

See also

setValue()

Return type

Any

valueChanged

Emitted whenever the value is changed in the widget. [signal]

wheelEvent(self, QWheelEvent)