22 #include <Qsci/qscilexercss.h>
38 QsciLexerCSS *lexer =
new QgsQsciLexerCSS(
this );
41 lexer->setDefaultFont( font );
42 lexer->setFont( font, -1 );
44 font.setItalic(
true );
45 lexer->setFont( font, QsciLexerCSS::Comment );
47 font.setItalic(
false );
49 lexer->setFont( font, QsciLexerCSS::SingleQuotedString );
50 lexer->setFont( font, QsciLexerCSS::DoubleQuotedString );
80 QgsQsciLexerCSS::QgsQsciLexerCSS( QObject *parent )
81 : QsciLexerCSS( parent )
86 QString QgsQsciLexerCSS::description(
int style )
const
89 if ( style == QsciLexerCSS::Comment )
90 return QStringLiteral(
"Comment" );
92 return QsciLexerCSS::description( style );
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 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.