TextEditor: add convenience function to clear all extra highlights

Change-Id: Id3a3c45041a23ba100447d926ed6ab829abbc92b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2019-06-13 09:56:39 +02:00
parent c05ec2833e
commit 2eddd65596
3 changed files with 12 additions and 8 deletions

View File

@@ -721,6 +721,15 @@ void SyntaxHighlighter::clearExtraFormats(const QTextBlock &block)
d->inReformatBlocks = wasInReformatBlocks;
}
void SyntaxHighlighter::clearAllExtraFormats()
{
QTextBlock b = document()->firstBlock();
while (b.isValid()) {
clearExtraFormats(b);
b = b.next();
}
}
/* Generate at least n different colors for highlighting, excluding background
* color. */