Store the QTextCharFormat used to mark virtual methods.

This commit is contained in:
Roberto Raggi
2010-08-09 10:34:31 +02:00
parent cdf9d03e62
commit 649559ade3
3 changed files with 5 additions and 20 deletions

View File

@@ -988,9 +988,6 @@ void CPPEditor::highlightTypeUsages(int from, int to)
Q_ASSERT(!chunks.isEmpty());
QTextBlock b = doc->findBlockByNumber(m_nextHighlightBlockNumber);
QTextCharFormat virtualMethodFormat; // ### hardcoded;
virtualMethodFormat.setFontItalic(true);
QMapIterator<int, QVector<SemanticInfo::Use> > it(chunks);
while (b.isValid() && it.hasNext()) {
it.next();
@@ -1021,7 +1018,7 @@ void CPPEditor::highlightTypeUsages(int from, int to)
break;
case SemanticInfo::Use::VirtualMethod:
formatRange.format = virtualMethodFormat;
formatRange.format = m_virtualMethodFormat;
break;
default:
@@ -1746,6 +1743,8 @@ void CPPEditor::setFontSettings(const TextEditor::FontSettings &fs)
m_fieldFormat = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_FIELD));
m_keywordFormat = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_KEYWORD));
m_virtualMethodFormat.setFontItalic(true); // ### hardcoded
// only set the background, we do not want to modify foreground properties set by the syntax highlighter or the link
m_occurrencesFormat.clearForeground();
m_occurrenceRenameFormat.clearForeground();