Class: QgsCodeEditorSQL

A SQL editor based on QScintilla2. Adds syntax highlighting and code autocompletion.

Note

may not be available in Python bindings, depending on platform support

QgsCodeEditorSQL containing sample SQL

QgsCodeEditorSQL containing sample SQL

Class Hierarchy

Inheritance diagram of qgis.gui.QgsCodeEditorSQL

Base classes

QgsCodeEditor

A text editor based on QScintilla2.

QsciScintilla

QsciScintillaBase

QAbstractScrollArea

QFrame

QWidget

QObject

QPaintDevice

Methods

extraKeywords

Returns the extra keywords.

fieldNames

Returns field names from the lexer API.

setExtraKeywords

Set extra keywords to extraKeywords.

setFieldNames

Set field names to fieldNames to be added to the lexer API.

setFields

Set field names to be added to the lexer API.

class qgis.gui.QgsCodeEditorSQL[source]

Bases: QgsCodeEditor

__init__(parent: QWidget | None = None)

Constructor for QgsCodeEditorSQL

Parameters:

parent (Optional[QWidget] = None)

extraKeywords(self) List[str][source]

Returns the extra keywords.

Extra keywords are usually added from provider connections and represent function and other provider specific keywords.

Added in version 3.22.

Return type:

List[str]

fieldNames(self) List[str][source]

Returns field names from the lexer API.

Added in version 3.22.

Return type:

List[str]

setExtraKeywords(self, extraKeywords: Iterable[str | None])[source]

Set extra keywords to extraKeywords.

Extra keywords are usually added from provider connections and represent function and other provider specific keywords.

Added in version 3.22.

Parameters:

extraKeywords (Iterable[Optional[str]])

setFieldNames(self, fieldNames: Iterable[str | None])[source]

Set field names to fieldNames to be added to the lexer API.

Added in version 3.18.

Parameters:

fieldNames (Iterable[Optional[str]])

setFields(self, fields: QgsFields)[source]

Set field names to be added to the lexer API.

Added in version 3.14.

Parameters:

fields (QgsFields)