Class: QgsProcessingMapLayerComboBox

class qgis.gui.QgsProcessingMapLayerComboBox(parameter: QgsProcessingParameterDefinition, 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()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
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()
destroy()
disconnectNotify()
dragEnterEvent(self, event: QDragEnterEvent)
Parameters

event (QDragEnterEvent) –

dragLeaveEvent(self, event: QDragLeaveEvent)
Parameters

event (QDragLeaveEvent) –

dragMoveEvent()
dropEvent(self, event: QDropEvent)
Parameters

event (QDropEvent) –

enterEvent()
event()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent()
sender()
senderSignalIndex()
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
sharedPainter()
showEvent()
tabletEvent()
timerEvent()
triggerFileSelection

Emitted when the widget has triggered a file selection operation (to be handled in Python for now). [signal]

updateMicroFocus()
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()