Add-qt5.12.12-compatibility (#127)

add qt5.12.12 compatibility

QList::swapItemsAt was introduced in Qt 5.13.
and more ,,, thanks to https://github.com/Social-Mean
This commit is contained in:
Social_Mean 2024-03-18 17:42:32 +08:00 committed by GitHub
parent 6482ff7a49
commit be48ed84ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View File

@ -44,7 +44,7 @@ protected:
inline Data(const std::function<void(void)>& 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<JKQTPlotter*(void)> p_):

View File

@ -664,7 +664,10 @@ JKQTCOMMON_LIB_EXPORT void jkqtp_estimateFraction(double input, int &sign, uint6
*/
template <class T>
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

View File

@ -534,7 +534,7 @@ void doListStyles(const QDir& outputDir, const QStringList& doctomodify, int ico
shtml<<"<table>\n <tr>\n <th>Style-file\n <th>Screenshot\n <th>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 "<<f;