diff options
author | hjk <qtc-committer@nokia.com> | 2012-04-26 14:17:42 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-05-03 13:11:25 +0200 |
commit | d006ca80a62ba94fbde3d992cf0565fa44f5b8ba (patch) | |
tree | 7e35fa19be7d7847fbcae6152bda0776bb589fbd /src/plugins/texteditor/plaintexteditor.cpp | |
parent | a872c91c64893c739ae842fdba1d755e780ad4a5 (diff) | |
download | qt-creator-d006ca80a62ba94fbde3d992cf0565fa44f5b8ba.tar.gz |
texteditor: use an enum instead of QString as color ids
Change-Id: I658412c18d5ccfe978ec444451c6417ffb18d71c
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/texteditor/plaintexteditor.cpp')
-rw-r--r-- | src/plugins/texteditor/plaintexteditor.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp index 90a30a2381..ed894679c3 100644 --- a/src/plugins/texteditor/plaintexteditor.cpp +++ b/src/plugins/texteditor/plaintexteditor.cpp @@ -110,26 +110,17 @@ void PlainTextEditorWidget::setFontSettings(const FontSettings &fs) Highlighter *highlighter = static_cast<Highlighter *>(baseTextDocument()->syntaxHighlighter()); - highlighter->configureFormat(Highlighter::VisualWhitespace, fs.toTextCharFormat( - QLatin1String(Constants::C_VISUAL_WHITESPACE))); - highlighter->configureFormat(Highlighter::Keyword, fs.toTextCharFormat( - QLatin1String(Constants::C_KEYWORD))); - highlighter->configureFormat(Highlighter::DataType, fs.toTextCharFormat( - QLatin1String(Constants::C_TYPE))); - highlighter->configureFormat(Highlighter::Comment, fs.toTextCharFormat( - QLatin1String(Constants::C_COMMENT))); + highlighter->configureFormat(Highlighter::VisualWhitespace, fs.toTextCharFormat(C_VISUAL_WHITESPACE)); + highlighter->configureFormat(Highlighter::Keyword, fs.toTextCharFormat(C_KEYWORD)); + highlighter->configureFormat(Highlighter::DataType, fs.toTextCharFormat(C_TYPE)); + highlighter->configureFormat(Highlighter::Comment, fs.toTextCharFormat(C_COMMENT)); // Using C_NUMBER for all kinds of numbers. - highlighter->configureFormat(Highlighter::Decimal, fs.toTextCharFormat( - QLatin1String(Constants::C_NUMBER))); - highlighter->configureFormat(Highlighter::BaseN, fs.toTextCharFormat( - QLatin1String(Constants::C_NUMBER))); - highlighter->configureFormat(Highlighter::Float, fs.toTextCharFormat( - QLatin1String(Constants::C_NUMBER))); + highlighter->configureFormat(Highlighter::Decimal, fs.toTextCharFormat(C_NUMBER)); + highlighter->configureFormat(Highlighter::BaseN, fs.toTextCharFormat(C_NUMBER)); + highlighter->configureFormat(Highlighter::Float, fs.toTextCharFormat(C_NUMBER)); // Using C_STRING for strings and chars. - highlighter->configureFormat(Highlighter::Char, fs.toTextCharFormat( - QLatin1String(Constants::C_STRING))); - highlighter->configureFormat(Highlighter::String, fs.toTextCharFormat( - QLatin1String(Constants::C_STRING))); + highlighter->configureFormat(Highlighter::Char, fs.toTextCharFormat(C_STRING)); + highlighter->configureFormat(Highlighter::String, fs.toTextCharFormat(C_STRING)); highlighter->rehighlight(); } |