Commit 25af37dc authored by Pino Toscano's avatar Pino Toscano Committed by Philipp Erhardt
Browse files

qStableSort -> std::stable_sort

Qt5 deprecates most of its own algorithms in favour of C++ native ones,
so use latter when building with Qt5.
parent df5c5549
......@@ -59,7 +59,11 @@ QRectF SelectionLine::get_bbox() const {
}
void SelectionLine::sort() {
#if QT_VERSION >= 0x050000
std::stable_sort(parts.begin(), parts.end(), selection_less_x);
#else
qStableSort(parts.begin(), parts.end(), selection_less_x);
#endif
}
bool selection_less_x(const SelectionPart *a, const SelectionPart *b) {
......
......@@ -195,7 +195,11 @@ void Worker::run() {
}
// sort by y coordinate
#if QT_VERSION >= 0x050000
std::stable_sort(selection_parts.begin(), selection_parts.end(), selection_less_y);
#else
qStableSort(selection_parts.begin(), selection_parts.end(), selection_less_y);
#endif
QRectF line_box;
QList<SelectionLine *> *lines = new QList<SelectionLine *>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment