Class: QgsProcessingAbstractParameterDefinitionWidget

class qgis.gui.QgsProcessingAbstractParameterDefinitionWidget

Bases: PyQt5.QtWidgets.QWidget, QgsExpressionContextGenerator

Abstract base class for widgets which allow users to specify the properties of a Processing parameter.

New in version 3.10.

QgsProcessingAbstractParameterDefinitionWidget(context: QgsProcessingContext, widgetContext: QgsProcessingParameterWidgetContext, definition: QgsProcessingParameterDefinition = None, algorithm: QgsProcessingAlgorithm = None, parent: QWidget = None) Creates a new QgsProcessingAbstractParameterDefinitionWidget, with the specified parent widget.

The context argument must specify a Processing context, which will be used by the widget to evaluate existing definition properties such as default values. Similarly, the widgetContext argument specifies the wider GUI context in which the widget will be used.

The optional definition argument may be used to provide a parameter definition to use to initially populate the widget’s state.

Additionally, the optional algorithm parameter may be used to specify the algorithm or model associated with the parameter.

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

createExpressionContext

rtype:

QgsExpressionContext

createParameter

Returns a new instance of a parameter definition, using the current settings defined in the dialog.

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

dropEvent

enterEvent

event

focusInEvent

focusNextChild

focusNextPrevChild

focusOutEvent

focusPreviousChild

hideEvent

initPainter

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

registerProcessingContextGenerator

Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required.

resizeEvent

sender

senderSignalIndex

setWidgetContext

Sets the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

wheelEvent

widgetContext

Returns the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

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)
createExpressionContext(self) QgsExpressionContext
Return type:

QgsExpressionContext

createParameter(self, name: str, description: str, flags: QgsProcessingParameterDefinition.Flags | QgsProcessingParameterDefinition.Flag) QgsProcessingParameterDefinition

Returns a new instance of a parameter definition, using the current settings defined in the dialog.

Common properties for parameters, including the name, description, and parameter flags are passed to the method. Subclass implementations must use these properties when crafting a parameter definition which also respects the additional properties specific to the parameter type handled by the widget subclass.

Parameters:
Return type:

QgsProcessingParameterDefinition

customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
dropEvent(self, 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)
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
registerProcessingContextGenerator(self, generator: QgsProcessingContextGenerator)

Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required.

New in version 3.18.

Parameters:

generator (QgsProcessingContextGenerator) –

resizeEvent(self, QResizeEvent)
sender(self) QObject
senderSignalIndex(self) int
setWidgetContext(self, context: QgsProcessingParameterWidgetContext)

Sets the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

Subclasses should take care to call the base class method when reimplementing this method.

See also

widgetContext()

New in version 3.18.

Parameters:

context (QgsProcessingParameterWidgetContext) –

sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
wheelEvent(self, QWheelEvent)
widgetContext(self) QgsProcessingParameterWidgetContext

Returns the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

New in version 3.18.

Return type:

QgsProcessingParameterWidgetContext