forked from qt-creator/qt-creator
Add common interface for text formats inside syntax highlighter
Change-Id: I87f64446161a57aea0896f68e4eafacef791969b Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -1887,14 +1887,10 @@ const Utils::CommentDefinition *CPPEditor::commentDefinition() const
|
||||
void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
{
|
||||
TextEditor::BaseTextEditorWidget::setFontSettings(fs);
|
||||
CppHighlighter *highlighter
|
||||
= qobject_cast<CppHighlighter*>(baseTextDocument()->syntaxHighlighter());
|
||||
TextEditor::SyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter();
|
||||
if (!highlighter)
|
||||
return;
|
||||
|
||||
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(highlighterFormatCategories());
|
||||
highlighter->setFormats(formats.constBegin(), formats.constEnd());
|
||||
|
||||
m_occurrencesFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES);
|
||||
m_occurrencesUnusedFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_UNUSED);
|
||||
m_occurrencesUnusedFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
|
||||
|
||||
Reference in New Issue
Block a user