Class: QgsExpressionContextGenerator

Abstract interface for generating an expression context.

You need to implement this interface in a class and register this class with QgsFieldExpressionWidget.registerExpressionGenerator().

This is used for example in QgsPropertyOverrideButton or QgsFieldExpressionWidget classes which will ask for a new QgsExpressionContext every time the expression editor is opened. This way they are able to provide an up-to-date expression editor even when the environment changes.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: createExpressionContext()

Class Hierarchy

Inheritance diagram of qgis.core.QgsExpressionContextGenerator

Subclasses

QgsVectorLayer

Represents a vector layer which manages a vector based dataset.

QgsLayout

Base class for layouts, which can contain items such as maps, labels, scalebars, etc.

QgsLayoutAtlas

Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.

QgsLayoutObject

A base class for objects which belong to a layout.

QgsProject

Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.

QgsRendererWidget

Base class for renderer settings widgets.

QgsAbstractProcessingParameterWidgetWrapper

A widget wrapper for Processing parameter value widgets.

QgsNumericFormatWidget

Base class for widgets which allow control over the properties of QgsNumericFormat subclasses.

QgsMapCanvas

Map canvas is a class for displaying all GIS data types on a canvas.

QgsEditorConfigWidget

Base class for widgets which configure editor widget types.

QgsLayerPropertiesWidget

A widget which allows configuration of the properties of a single QgsSymbolLayer.

QgsProcessingAbstractParameterDefinitionWidget

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

QgsProcessingAlgorithmConfigurationWidget

A configuration widget for processing algorithms allows providing additional configuration options directly on algorithm level, in addition to parameters.

QgsProcessingModelerParameterWidget

A widget for customising the value of Processing algorithm parameters inside a Processing model.

QgsTextFormatWidget

A widget for customizing text formatting settings.

QgsVectorLayerTemporalPropertiesWidget

A widget for configuring the temporal properties for a vector layer.

Abstract Methods

createExpressionContext

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

class qgis.core.QgsExpressionContextGenerator[source]

Bases: object

abstract createExpressionContext(self) QgsExpressionContext[source]

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Return type:

QgsExpressionContext