21#include <Qsci/qscilexercss.h>
45 QsciLexerCSS *lexer =
new QgsQsciLexerCSS(
this );
48 lexer->setDefaultFont( font );
49 lexer->setFont( font, -1 );
51 font.setItalic(
true );
52 lexer->setFont( font, QsciLexerCSS::Comment );
54 font.setItalic(
false );
56 lexer->setFont( font, QsciLexerCSS::SingleQuotedString );
57 lexer->setFont( font, QsciLexerCSS::DoubleQuotedString );
87QgsQsciLexerCSS::QgsQsciLexerCSS( QObject *parent )
88 : QsciLexerCSS( parent )
93QString QgsQsciLexerCSS::description(
int style )
const
96 if ( style == QsciLexerCSS::Comment )
97 return QStringLiteral(
"Comment" );
99 return QsciLexerCSS::description( style );
ScriptLanguage
Scripting languages.
Qgis::ScriptLanguage language() const override
Returns the associated scripting language.
void initializeLexer() override
Called when the dialect specific code lexer needs to be initialized (or reinitialized).
QgsCodeEditorCSS(QWidget *parent=nullptr)
Constructor for QgsCodeEditorCSS.
@ Identifier
Identifier color.
@ DoubleQuote
Double quote color.
@ Default
Default text color.
@ Background
Background color.
@ SingleQuote
Single quote color.
@ Operator
Operator color.
A text editor based on QScintilla2.
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.
Flag
Flags controlling behavior of code editor.
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.