Skip to content

Commit

Permalink
Add-qt5.12.12-compatibility (#127)
Browse files Browse the repository at this point in the history
add qt5.12.12 compatibility

QList::swapItemsAt was introduced in Qt 5.13.
and more ,,, thanks to https://github.com/Social-Mean
  • Loading branch information
Social-Mean authored Mar 18, 2024
1 parent 6482ff7 commit be48ed8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/libexampletools/jkqtpexampleapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Q_SLOTS:
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_):
Expand Down
5 changes: 4 additions & 1 deletion lib/jkqtcommon/jkqtpmathtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit be48ed8

Please sign in to comment.