diff options
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/highlighter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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(); |