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.

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

currentLayer

Returns the current layer selected in the combobox, or None if the selection cannot be represented as a map layer.

currentText

Returns the current text of the selected item in the combobox.

customEvent

destroy

disconnectNotify

dragEnterEvent

param event

dragLeaveEvent

param event

dragMoveEvent

dropEvent

param event

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isEditable

Returns whether the combo box value can be freely edited.

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

sender

senderSignalIndex

setEditable

Sets whether the combo box value can be freely edited.

setLayer

Sets the combo box to the specified layer, if layer is compatible with the widget’s parameter definition.

setValue

Sets the value shown in the widget.

setWidgetContext

Sets the context in which the widget is shown.

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

value

Returns the current value of the widget.

wheelEvent

Signals

valueChanged

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

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)