From 5a745f3c453aca1232341f453a71775ae7d0f871 Mon Sep 17 00:00:00 2001 From: Krasilnikov Sergei Date: Tue, 17 Jan 2023 14:26:42 +0300 Subject: [PATCH] fix build with qt5 --- qucs/syntax.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qucs/syntax.cpp b/qucs/syntax.cpp index 88535cde..d1ae79e3 100644 --- a/qucs/syntax.cpp +++ b/qucs/syntax.cpp @@ -248,8 +248,9 @@ void SyntaxHighlighter::setLanguage(int lang) void SyntaxHighlighter::highlightBlock(const QString &text) { for (const HighlightingRule &rule : highlightingRules) { QRegularExpression expression(rule.pattern); - QRegularExpressionMatch match = expression.match(text); - for (const QRegularExpressionMatch &match : expression.globalMatch(text)) { + QRegularExpressionMatchIterator iter = expression.globalMatch(text); + while (iter.hasNext()) { + QRegularExpressionMatch match = iter.next(); int length = match.capturedLength(); setFormat(match.capturedStart(), length, rule.format); }