diff options
author | David Schulz <david.schulz@qt.io> | 2024-01-29 13:43:46 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2024-01-31 13:15:44 +0000 |
commit | d651d8b41fa2ab746dcd912b88b09dbd4af10d13 (patch) | |
tree | 81e587560e5edb3997dca413c09900fcadf4f74a /src/plugins/glsleditor | |
parent | 256ae21c07b48be6616d2e14608471c4b63cac1c (diff) |
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>
Diffstat (limited to 'src/plugins/glsleditor')
-rw-r--r-- | src/plugins/glsleditor/glslhighlighter.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/plugins/glsleditor/glslhighlighter.cpp b/src/plugins/glsleditor/glslhighlighter.cpp index 3c6028e0dc..7c25b0abbf 100644 --- a/src/plugins/glsleditor/glslhighlighter.cpp +++ b/src/plugins/glsleditor/glslhighlighter.cpp @@ -47,10 +47,7 @@ void GlslHighlighter::highlightBlock(const QString &text) lex.setState(state); lex.setScanKeywords(false); lex.setScanComments(true); - const int variant = languageVariant(parent() - ? static_cast<TextDocument*>(parent())->mimeType() - : QString()); - lex.setVariant(variant); + lex.setVariant(languageVariant(mimeType())); int initialState = state; |