Class: QgsCodeEditorExpression

A QGIS expression editor based on QScintilla2.

Adds syntax highlighting and code autocompletion.

Added in version 3.4.

QgsCodeEditorExpression containing a sample QGIS expression

QgsCodeEditorExpression containing a sample QGIS expression

Class Hierarchy

Inheritance diagram of qgis.gui.QgsCodeEditorExpression

Base classes

QgsCodeEditor

A text editor based on QScintilla2.

QsciScintilla

QsciScintillaBase

QAbstractScrollArea

QFrame

QWidget

QObject

QPaintDevice

class qgis.gui.QgsCodeEditorExpression[source]

Bases: QgsCodeEditor

__init__(parent: QWidget | None = None)

Constructor for QgsCodeEditorExpression

Parameters:

parent (Optional[QWidget] = None)

setExpressionContext(self, context: QgsExpressionContext)[source]

Variables and functions from this expression context will be added to the API. Will also reload all globally registered functions.

Parameters:

context (QgsExpressionContext)

setFields(self, fields: QgsFields)[source]

Field names will be added to the API.

Parameters:

fields (QgsFields)