From 6e5f90917f4cbe092816ac82434f827f67082f4d Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 9 Dec 2015 12:24:53 +0100 Subject: Use text settings instead of hard coded diagnostic text formats Change-Id: Id51d03a46b4403d9224508ff3c7647b829ee69cd Reviewed-by: Nikolai Kosjar --- src/plugins/glsleditor/glsleditor.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/plugins/glsleditor') diff --git a/src/plugins/glsleditor/glsleditor.cpp b/src/plugins/glsleditor/glsleditor.cpp index b7fac825e0d..3a35ccadf74 100644 --- a/src/plugins/glsleditor/glsleditor.cpp +++ b/src/plugins/glsleditor/glsleditor.cpp @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -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 sels; QSet errors; -- cgit v1.2.3