diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index e08b9ad099c..b1044d26e20 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -424,9 +424,18 @@ inline void sort(Container &c, Predicate p) template inline void reverseForeach(const Container &c, const Op &operation) { +#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) + auto rend = c.begin(); + auto it = c.end(); + while (it != rend) { + --it; + operation(*it); + } +#else auto rend = c.rend(); for (auto it = c.rbegin(); it != rend; ++it) operation(*it); +#endif } }