aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-03 16:43:08 +0200
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-07-03 16:43:12 +0200
commit59adcfe30f70abe9f493d65f98ec54c59e17d9ce (patch)
tree614c0f6a539883677675b9df0e854987e93e4c1f /qtmips_gui
parent65448528d7141cdd2d0b2413d92d445cb8cd4f93 (diff)
downloadqtmips-59adcfe30f70abe9f493d65f98ec54c59e17d9ce.tar.gz
qtmips-59adcfe30f70abe9f493d65f98ec54c59e17d9ce.tar.bz2
qtmips-59adcfe30f70abe9f493d65f98ec54c59e17d9ce.zip
Minor fix to build on Qt version prior to 5.7.0.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/highlighter.cpp7
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();