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.

Added in version 3.8.

QgsProcessingMapLayerComboBox(parameter: Optional[QgsProcessingParameterDefinition], type: QgsProcessingGui.WidgetType = QgsProcessingGui.Standard, parent: Optional[QWidget] = None) Constructor for QgsProcessingMapLayerComboBox, with the specified parameter definition.

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

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

actionEvent(self, a0: QActionEvent | None)
changeEvent(self, a0: QEvent | None)
childEvent(self, a0: QChildEvent | None)
closeEvent(self, a0: QCloseEvent | None)
connectNotify(self, signal: QMetaMethod)
contextMenuEvent(self, a0: QContextMenuEvent | None)
create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)
currentLayer(self) QgsMapLayer | None

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:

Optional[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, a0: QEvent | None)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, signal: QMetaMethod)
dragEnterEvent(self, event: QDragEnterEvent | None)
Parameters:

event (Optional[QDragEnterEvent])

dragLeaveEvent(self, event: QDragLeaveEvent | None)
Parameters:

event (Optional[QDragLeaveEvent])

dragMoveEvent(self, a0: QDragMoveEvent | None)
dropEvent(self, event: QDropEvent | None)
Parameters:

event (Optional[QDropEvent])

enterEvent(self, a0: QEvent | None)
event(self, a0: QEvent | None) bool
focusInEvent(self, a0: QFocusEvent | None)
focusNextChild(self) bool
focusNextPrevChild(self, next: bool) bool
focusOutEvent(self, a0: QFocusEvent | None)
focusPreviousChild(self) bool
hideEvent(self, a0: QHideEvent | None)
initPainter(self, painter: QPainter | None)
inputMethodEvent(self, a0: QInputMethodEvent | None)
isEditable(self) bool

Returns whether the combo box value can be freely edited.

See also

setEditable()

Added in version 3.14.

Return type:

bool

isSignalConnected(self, signal: QMetaMethod) bool
keyPressEvent(self, a0: QKeyEvent | None)
keyReleaseEvent(self, a0: QKeyEvent | None)
leaveEvent(self, a0: QEvent | None)
metric(self, a0: QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, a0: QMouseEvent | None)
mouseMoveEvent(self, a0: QMouseEvent | None)
mousePressEvent(self, a0: QMouseEvent | None)
mouseReleaseEvent(self, a0: QMouseEvent | None)
moveEvent(self, a0: QMoveEvent | None)
nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)
paintEvent(self, a0: QPaintEvent | None)
receivers(self, signal: PYQT_SIGNAL) int
resizeEvent(self, a0: QResizeEvent | None)
sender(self) QObject | None
senderSignalIndex(self) int
setEditable(self, editable: bool)

Sets whether the combo box value can be freely edited.

See also

isEditable()

Added in version 3.14.

Parameters:

editable (bool)

setLayer(self, layer: QgsMapLayer | None)

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

Parameters:

layer (Optional[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.

Added in version 3.14.

Parameters:

context (QgsProcessingParameterWidgetContext)

sharedPainter(self) QPainter | None
showEvent(self, a0: QShowEvent | None)
tabletEvent(self, a0: QTabletEvent | None)
timerEvent(self, a0: QTimerEvent | None)
updateMicroFocus(self)
value(self) Any

Returns the current value of the widget.

See also

setValue()

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, a0: QWheelEvent | None)