Class: QgsVectorLayerToolsContext

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

Added in version 3.38.

class qgis.core.QgsVectorLayerToolsContext[source]

Bases: object

additionalExpressionContextScope(self) QgsExpressionContextScope | None[source]

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

Return type:

Optional[QgsExpressionContextScope]

expressionContext(self) QgsExpressionContext | None[source]

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

Return type:

Optional[QgsExpressionContext]

hideParent(self) bool[source]

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

Return type:

bool

parentWidget(self) QWidget | None[source]

Returns the widget which should be parented to tools dialogues.

Return type:

Optional[QWidget]

setAdditionalExpressionContextScope(self, scope: QgsExpressionContextScope | None)[source]

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)[source]

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)[source]

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

Parameters:

hide (bool)

setParentWidget(self, parent: QWidget | None)[source]

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

Parameters:

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

setShowModal(self, modal: bool)[source]

Sets whether tools’ dialogues should be modal.

Parameters:

modal (bool)

showModal(self) bool[source]

Returns whether tools’ dialogues should be modal.

Return type:

bool