From 8bb7093c4269a153815771155f1158eeef96ba65 Mon Sep 17 00:00:00 2001 From: Social_Mean Date: Fri, 15 Mar 2024 22:01:46 +0800 Subject: [PATCH 1/4] add qt5.12.12 compatibility QList::swapItemsAt was introduced in Qt 5.13. --- .../jkqtplotter_doc_imagegenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jkqtplotter_doc_imagegenerator/jkqtplotter_doc_imagegenerator.cpp b/tools/jkqtplotter_doc_imagegenerator/jkqtplotter_doc_imagegenerator.cpp index c9bc2b6f451..24c9a3c4d38 100644 --- a/tools/jkqtplotter_doc_imagegenerator/jkqtplotter_doc_imagegenerator.cpp +++ b/tools/jkqtplotter_doc_imagegenerator/jkqtplotter_doc_imagegenerator.cpp @@ -534,7 +534,7 @@ void doListStyles(const QDir& outputDir, const QStringList& doctomodify, int ico shtml<<"\n \n
Style-file\n Screenshot\n Symbols\n"; auto files=dir.entryList(); if (files.indexOf("default.ini")>=0) { - files.swapItemsAt(0,files.indexOf("default.ini")); + qSwap(files[0], files[files.indexOf("default.ini")]); } for (auto& f: files) { qDebug()<<"plotting example for style "< Date: Fri, 15 Mar 2024 22:02:37 +0800 Subject: [PATCH 2/4] add qt5.12.12-compatibility --- lib/jkqtcommon/jkqtpmathtools.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/jkqtcommon/jkqtpmathtools.h b/lib/jkqtcommon/jkqtpmathtools.h index 682fbaa7163..a1b17e6c261 100644 --- a/lib/jkqtcommon/jkqtpmathtools.h +++ b/lib/jkqtcommon/jkqtpmathtools.h @@ -664,7 +664,10 @@ JKQTCOMMON_LIB_EXPORT void jkqtp_estimateFraction(double input, int &sign, uint6 */ template inline T jkqtp_reversed(const T& l) { - return T(l.rbegin(), l.rend()); + T reversed_l; + reversed_l.reserve(l.size()); + std::reverse_copy(l.begin(), l.end(), std::back_inserter(reversed_l)); + return reversed_l; } /*! \brief can be used to build a hash-values from several hash-values From cbaa47921691301e228237ce3924df86b0b5a93b Mon Sep 17 00:00:00 2001 From: Social_Mean Date: Fri, 15 Mar 2024 22:03:33 +0800 Subject: [PATCH 3/4] add qt5.12.12-compatibility I'm not sure if I added this line correctly, but now it doesn't report errors. --- examples/libexampletools/jkqtpexampleapplication.h | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/libexampletools/jkqtpexampleapplication.h b/examples/libexampletools/jkqtpexampleapplication.h index 17da0f6d6d0..058fc3e2442 100644 --- a/examples/libexampletools/jkqtpexampleapplication.h +++ b/examples/libexampletools/jkqtpexampleapplication.h @@ -41,6 +41,7 @@ public Q_SLOTS: std::function f; std::function plotf; JKQTPlotter* p; + inline Data() {}; inline Data(const std::function& f_): type(FunctorType), f(f_), plotf(), p(nullptr) {} From 5e563b3b4e869b8ce6006e7c7951d7af4f00eaea Mon Sep 17 00:00:00 2001 From: Social_Mean Date: Mon, 18 Mar 2024 11:56:10 +0800 Subject: [PATCH 4/4] fix: add default argument in Data's constructor --- examples/libexampletools/jkqtpexampleapplication.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/libexampletools/jkqtpexampleapplication.h b/examples/libexampletools/jkqtpexampleapplication.h index 058fc3e2442..b7502af8db5 100644 --- a/examples/libexampletools/jkqtpexampleapplication.h +++ b/examples/libexampletools/jkqtpexampleapplication.h @@ -41,11 +41,10 @@ public Q_SLOTS: std::function f; std::function plotf; JKQTPlotter* p; - inline Data() {}; inline Data(const std::function& f_): type(FunctorType), f(f_), plotf(), p(nullptr) {} - inline Data(JKQTPlotter* p_): + inline Data(JKQTPlotter* p_=nullptr): type(PlotterType), f(), plotf(), p(p_) {} inline Data(std::function p_):