Class: QgsVectorLayerToolsContext

class qgis.core.QgsVectorLayerToolsContext

Bases: sip.wrapper

Contains settings which reflect the context in which vector layer tool operations should consider.

Added in version 3.38.

QgsVectorLayerToolsContext() Constructor for QgsVectorLayerToolsContext.

QgsVectorLayerToolsContext(other: QgsVectorLayerToolsContext) Copy constructor.

Parameters:

other

source QgsVectorLayerToolsContext

Methods

additionalExpressionContextScope

Returns an additional expression context scope to be made available when calculating expressions.

expressionContext

Returns the optional expression context used by the vector layer tools.

hideParent

Returns whether the parent widget should be hidden when showing tools' dialogues.

parentWidget

Returns the widget which should be parented to tools dialogues.

setAdditionalExpressionContextScope

Sets an additional expression context scope to be made available when calculating expressions.

setExpressionContext

Sets the optional expression context used by the vector layer tools.

setHideParent

Sets whether the parent widget should be hidden when showing tools' dialogues.

setParentWidget

Sets the widget which should be parented to tools' dialogues.

setShowModal

Sets whether tools' dialogues should be modal.

showModal

Returns whether tools' dialogues should be modal.

additionalExpressionContextScope(self) QgsExpressionContextScope | None

Returns an additional expression context scope to be made available when calculating expressions.

Return type:

Optional[QgsExpressionContextScope]

expressionContext(self) QgsExpressionContext | None

Returns the optional expression context used by the vector layer tools.

Return type:

Optional[QgsExpressionContext]

hideParent(self) bool

Returns whether the parent widget should be hidden when showing tools’ dialogues.

Return type:

bool

parentWidget(self) QWidget | None

Returns the widget which should be parented to tools dialogues.

Return type:

Optional[QWidget]

setAdditionalExpressionContextScope(self, scope: QgsExpressionContextScope | None)

Sets an additional expression context scope to be made available when calculating expressions.

Parameters:

scope (Optional[QgsExpressionContextScope]) – additional scope. Ownership is not transferred and a copy will be made.

setExpressionContext(self, context: QgsExpressionContext | None)

Sets the optional expression context used by the vector layer tools.

Parameters:

context (Optional[QgsExpressionContext]) – expression context pointer. Ownership is not transferred.

setHideParent(self, hide: bool)

Sets whether the parent widget should be hidden when showing tools’ dialogues.

Parameters:

hide (bool)

setParentWidget(self, parent: QWidget | None)

Sets the widget which should be parented to tools’ dialogues.

Parameters:

parent (Optional[QWidget]) – the widget actign as parent

setShowModal(self, modal: bool)

Sets whether tools’ dialogues should be modal.

Parameters:

modal (bool)

showModal(self) bool

Returns whether tools’ dialogues should be modal.

Return type:

bool