GlslEditor: Fix crash in GlslHighlighter

since the async highlighter implementation the parent is not a
TextDocument anymore, but a QTextDocument. Pass the required mimeType
via the SyntaxHighlighterRunner now to the SyntaxHighlighter.

Change-Id: I0afcbe68719195649b4b7040416a743cb01214df
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
This commit is contained in:
David Schulz
2024-01-29 13:43:46 +01:00
parent 256ae21c07
commit d651d8b41f
7 changed files with 32 additions and 12 deletions

View File

@@ -921,7 +921,10 @@ void TextDocument::resetSyntaxHighlighter(const std::function<SyntaxHighlighter
= qtcEnvironmentVariable("QTC_USE_THREADED_HIGHLIGHTER", "TRUE").toUpper()
== QLatin1String("TRUE");
d->m_highlighterRunner = new SyntaxHighlighterRunner(creator, document(), threaded && envValue);
d->m_highlighterRunner = new SyntaxHighlighterRunner(creator,
document(),
threaded && envValue,
mimeType());
}
void TextDocument::cleanWhitespace(const QTextCursor &cursor)