diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-01-21 11:26:39 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-01-24 08:00:07 +0100 |
commit | 3fa6b6737c48049cb3d6e06ef0c1cfcb30dfd595 (patch) | |
tree | b67162542fb606e2265da414f1525e9141153cb1 /src/plugins/cppeditor | |
parent | b59d61e2a42fd226d3009bf7c48e6fa9fffbb85e (diff) | |
download | qt-creator-3fa6b6737c48049cb3d6e06ef0c1cfcb30dfd595.tar.gz |
TextEditors: Move font settings to document
Change-Id: I325764cbaa9684fa2758b0ea6c6ea58de142cb73
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r-- | src/plugins/cppeditor/cppeditor.cpp | 5 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppeditor.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 1d91d128f5..98c169cc3c 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1529,13 +1529,14 @@ TextEditor::CompletionAssistProvider *CPPEditor::completionAssistProvider() return CppModelManagerInterface::instance()->cppEditorSupport(this)->completionAssistProvider(); } -void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) +void CPPEditorWidget::applyFontSettings() { - TextEditor::BaseTextEditorWidget::setFontSettings(fs); + TextEditor::BaseTextEditorWidget::applyFontSettings(); TextEditor::SyntaxHighlighter *highlighter = baseTextDocument()->syntaxHighlighter(); if (!highlighter) return; + const TextEditor::FontSettings &fs = baseTextDocument()->fontSettings(); m_occurrencesFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES); m_occurrencesUnusedFormat = fs.toTextCharFormat(TextEditor::C_OCCURRENCES_UNUSED); m_occurrencesUnusedFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline); diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 62ade9bfb9..2ca2e26bc0 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -145,7 +145,6 @@ Q_SIGNALS: void outlineModelIndexChanged(const QModelIndex &index); public Q_SLOTS: - virtual void setFontSettings(const TextEditor::FontSettings &); void setSortedOutline(bool sort); void switchDeclarationDefinition(bool inNextSplit); void renameSymbolUnderCursor(); @@ -162,6 +161,7 @@ protected: void contextMenuEvent(QContextMenuEvent *); void keyPressEvent(QKeyEvent *e); + void applyFontSettings(); TextEditor::BaseTextEditor *createEditor(); const CPlusPlus::Macro *findCanonicalMacro(const QTextCursor &cursor, |