23 #include <Qsci/qscilexerhtml.h>
38 void QgsCodeEditorHTML::setSciLexerHTML()
40 QHash< QString, QColor > colors;
44 for (
const auto &key : ini.allKeys() )
51 QColor defaultColor = colors.value( QStringLiteral(
"html/defaultFontColor" ), Qt::black );
53 QsciLexerHTML *lexer =
new QsciLexerHTML(
this );
54 lexer->setDefaultFont( font );
55 lexer->setDefaultColor( defaultColor );
56 lexer->setDefaultPaper( colors.value( QStringLiteral(
"html/paperBackgroundColor" ), Qt::white ) );
57 lexer->setFont( font, -1 );
59 lexer->setColor( defaultColor, QsciLexerHTML::Default );
60 lexer->setColor( colors.value( QStringLiteral(
"html/tagFontColor" ), QColor( 66, 113, 174 ) ), QsciLexerHTML::Tag );
61 lexer->setColor( colors.value( QStringLiteral(
"html/unknownTagFontColor" ), QColor( 255, 0, 0 ) ), QsciLexerHTML::UnknownTag );
62 lexer->setColor( colors.value( QStringLiteral(
"html/numberFontColor" ), QColor( 200, 40, 41 ) ), QsciLexerHTML::HTMLNumber );
63 lexer->setColor( colors.value( QStringLiteral(
"html/commentFontColor" ), QColor( 142, 144, 140 ) ), QsciLexerHTML::HTMLComment );
64 lexer->setColor( colors.value( QStringLiteral(
"html/singleQuoteFontColor" ), QColor( 113, 140, 0 ) ), QsciLexerHTML::HTMLSingleQuotedString );
65 lexer->setColor( colors.value( QStringLiteral(
"html/doubleQuoteFontColor" ), QColor( 113, 140, 0 ) ), QsciLexerHTML::HTMLDoubleQuotedString );