33 setAutoCompletionCaseSensitivity(
false );
42 mSqlLexer =
new QgsCaseInsensitiveLexerSQL(
this );
43 mSqlLexer->setDefaultFont( font );
46 mSqlLexer->setFont( font, -1 );
48 mSqlLexer->setFont( font, QsciLexerSQL::Keyword );
50 font.setBold(
false );
51 font.setItalic(
true );
52 mSqlLexer->setFont( font, QsciLexerSQL::Comment );
53 mSqlLexer->setFont( font, QsciLexerSQL::CommentLine );
55 mSqlLexer->setColor(
defaultColor, QsciLexerSQL::Default );
67 setLexer( mSqlLexer );
84 void QgsCodeEditorSQL::updateApis()
86 mApis =
new QsciAPIs( mSqlLexer );
88 for (
const QString &fieldName : std::as_const( mFieldNames ) )
90 mApis->add( fieldName );
94 mSqlLexer->setAPIs( mApis );
@ QuotedOperator
Quoted operator color.
@ Identifier
Identifier color.
@ DoubleQuote
Double quote color.
@ QuotedIdentifier
Quoted identifier color.
@ CommentLine
Line comment color.
@ Default
Default text color.
@ Background
Background color.
@ SingleQuote
Single quote color.
@ Operator
Operator color.
QgsCodeEditorSQL(QWidget *parent=nullptr)
Constructor for QgsCodeEditorSQL.
void initializeLexer() override
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
void setFields(const QgsFields &fields)
Set field names to be added to the lexer API.
A text editor based on QScintilla2.
void setFoldingVisible(bool folding)
Set whether the folding controls are visible in the editor.
void runPostLexerConfigurationTasks()
Performs tasks which must be run after a lexer has been set for the widget.
void setTitle(const QString &title)
Set the widget title.
QFont lexerFont() const
Returns the font to use in the lexer.
QColor lexerColor(QgsCodeEditorColorScheme::ColorRole role) const
Returns the color to use in the lexer for the specified role.
static QColor defaultColor(QgsCodeEditorColorScheme::ColorRole role, const QString &theme=QString())
Returns the default color for the specified role.
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.