Use text settings instead of hard coded diagnostic text formats

Change-Id: Id51d03a46b4403d9224508ff3c7647b829ee69cd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Marco Bubke
2015-12-09 12:24:53 +01:00
parent 4453ed4fc2
commit 6e5f90917f
5 changed files with 38 additions and 34 deletions

View File

@@ -53,6 +53,7 @@
#include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h>
#include <texteditor/fontsettings.h>
#include <texteditor/refactoroverlay.h>
#include <texteditor/textdocument.h>
#include <texteditor/syntaxhighlighter.h>
@@ -236,13 +237,10 @@ void GlslEditorWidget::updateDocumentNow()
CreateRanges createRanges(document(), doc);
createRanges(ast);
QTextCharFormat errorFormat;
errorFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
errorFormat.setUnderlineColor(Qt::red);
const TextEditor::FontSettings &fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
QTextCharFormat warningFormat;
warningFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
warningFormat.setUnderlineColor(Qt::darkYellow);
QTextCharFormat warningFormat = fontSettings.toTextCharFormat(TextEditor::C_WARNING);
QTextCharFormat errorFormat = fontSettings.toTextCharFormat(TextEditor::C_ERROR);
QList<QTextEdit::ExtraSelection> sels;
QSet<int> errors;