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 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, QActionEvent)
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: PyQt5.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], PyQt5.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

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, QWheelEvent)