From 8d01908082fe0bfb57a5878677bc190a7f8f14b9 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Fri, 2 Feb 2024 15:00:10 +0100 Subject: [PATCH] FIXed error when running jkqtmathtext_render copiled with Qt5 (nned to use qSort instead of std::sort) --- tools/jkqtmathtext_render/jkqtmathtext_render.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/jkqtmathtext_render/jkqtmathtext_render.cpp b/tools/jkqtmathtext_render/jkqtmathtext_render.cpp index 42edbdf66d..6af87449ec 100644 --- a/tools/jkqtmathtext_render/jkqtmathtext_render.cpp +++ b/tools/jkqtmathtext_render/jkqtmathtext_render.cpp @@ -207,7 +207,12 @@ int main(int argc, char* argv[]) fileList<<" \n"; fileList<<" \n"; i=1; - std::sort(symbolsAll.begin(), symbolsAll.end(), [](const QString& a, const QString& b) { if (a.contains("harpoon") && !b.contains("harpoon")) return false; +#if (QT_VERSION>=QT_VERSION_CHECK(6, 0, 0)) + std::sort +#else + qSort +#endif + (symbolsAll.begin(), symbolsAll.end(), [](const QString& a, const QString& b) { if (a.contains("harpoon") && !b.contains("harpoon")) return false; else if (a.isLower() && b.isUpper()) return true; else if (a.isUpper() && b.isLower()) return false; else return a