From 59adcfe30f70abe9f493d65f98ec54c59e17d9ce Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 3 Jul 2019 16:43:08 +0200 Subject: Minor fix to build on Qt version prior to 5.7.0. Signed-off-by: Pavel Pisa --- qtmips_gui/highlighter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qtmips_gui') diff --git a/qtmips_gui/highlighter.cpp b/qtmips_gui/highlighter.cpp index baaa8d0..463bbb3 100644 --- a/qtmips_gui/highlighter.cpp +++ b/qtmips_gui/highlighter.cpp @@ -113,7 +113,12 @@ Highlighter::Highlighter(QTextDocument *parent) void Highlighter::highlightBlock(const QString &text) { - for (const HighlightingRule &rule : qAsConst(highlightingRules)) { +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) + foreach(const HighlightingRule &rule, highlightingRules) +#else + for (const HighlightingRule &rule : qAsConst(highlightingRules)) +#endif + { QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text); while (matchIterator.hasNext()) { QRegularExpressionMatch match = matchIterator.next(); -- cgit v1.2.3