forked from qt-creator/qt-creator
C++: optimize the semantic highlighting in the UI thread.
Done by reserving enough space in for the various QLists when created, and by preventing unnecessary copying of lists. Change-Id: I5a9f0f7042bbaa1cf5eb076b956c35f2191468c6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Erik Verbruggen
parent
ff6e100824
commit
97c6af9443
@@ -2008,7 +2008,8 @@ void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
// Clear all additional formats since they may have changed
|
||||
QTextBlock b = document()->firstBlock();
|
||||
while (b.isValid()) {
|
||||
highlighter->setExtraAdditionalFormats(b, QList<QTextLayout::FormatRange>());
|
||||
QList<QTextLayout::FormatRange> noFormats;
|
||||
highlighter->setExtraAdditionalFormats(b, noFormats);
|
||||
b = b.next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user