Remove deprecated QtAlgorithms calls from QtGui
QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: I324ddf6129fe8884ecea97ef47abb7c071dfb34c Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>bb10
parent
50a8a5e795
commit
aa3f358d43
|
|
@ -150,6 +150,8 @@
|
|||
#include <private/qgifhandler_p.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_IMAGEFORMATPLUGIN
|
||||
|
|
@ -1494,7 +1496,7 @@ QList<QByteArray> QImageReader::supportedImageFormats()
|
|||
for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
|
||||
sortedFormats << *it;
|
||||
|
||||
qSort(sortedFormats);
|
||||
std::sort(sortedFormats.begin(), sortedFormats.end());
|
||||
return sortedFormats;
|
||||
}
|
||||
|
||||
|
|
@ -1521,7 +1523,7 @@ QList<QByteArray> QImageReader::supportedMimeTypes()
|
|||
for (QSet<QByteArray>::ConstIterator it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it)
|
||||
sortedMimeTypes << *it;
|
||||
|
||||
qSort(sortedMimeTypes);
|
||||
std::sort(sortedMimeTypes.begin(), sortedMimeTypes.end());
|
||||
return sortedMimeTypes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,6 +123,8 @@
|
|||
#include <private/qgifhandler_p.h>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_IMAGEFORMATPLUGIN
|
||||
|
|
@ -755,7 +757,7 @@ QList<QByteArray> QImageWriter::supportedImageFormats()
|
|||
for (QSet<QByteArray>::ConstIterator it = formats.constBegin(); it != formats.constEnd(); ++it)
|
||||
sortedFormats << *it;
|
||||
|
||||
qSort(sortedFormats);
|
||||
std::sort(sortedFormats.begin(), sortedFormats.end());
|
||||
return sortedFormats;
|
||||
}
|
||||
|
||||
|
|
@ -797,7 +799,7 @@ QList<QByteArray> QImageWriter::supportedMimeTypes()
|
|||
for (QSet<QByteArray>::ConstIterator it = mimeTypes.constBegin(); it != mimeTypes.constEnd(); ++it)
|
||||
sortedMimeTypes << *it;
|
||||
|
||||
qSort(sortedMimeTypes);
|
||||
std::sort(sortedMimeTypes.begin(), sortedMimeTypes.end());
|
||||
return sortedMimeTypes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@
|
|||
#include "qregion.h"
|
||||
#include "qdebug.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
void qt_format_text(const QFont &fnt, const QRectF &_r,
|
||||
|
|
@ -1798,7 +1800,7 @@ QList<QByteArray> QPictureIO::inputFormats()
|
|||
result.append(p->format);
|
||||
}
|
||||
}
|
||||
qSort(result);
|
||||
std::sort(result.begin(), result.end());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
#include <private/qstandarditemmodel_p.h>
|
||||
#include <qdebug.h>
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -254,10 +255,10 @@ void QStandardItemPrivate::sortChildren(int column, Qt::SortOrder order)
|
|||
|
||||
if (order == Qt::AscendingOrder) {
|
||||
QStandardItemModelLessThan lt;
|
||||
qStableSort(sortable.begin(), sortable.end(), lt);
|
||||
std::stable_sort(sortable.begin(), sortable.end(), lt);
|
||||
} else {
|
||||
QStandardItemModelGreaterThan gt;
|
||||
qStableSort(sortable.begin(), sortable.end(), gt);
|
||||
std::stable_sort(sortable.begin(), sortable.end(), gt);
|
||||
}
|
||||
|
||||
QModelIndexList changedPersistentIndexesFrom, changedPersistentIndexesTo;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
#include <QtCore/QUrl>
|
||||
#include <QtGui/QColor>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
/*!
|
||||
|
|
@ -183,7 +185,7 @@ QColorDialogStaticData::QColorDialogStaticData() : customSet(false)
|
|||
for (int r = 0; r < 4; ++r)
|
||||
for (int b = 0; b < 3; ++b)
|
||||
standardRgb[i++] = qRgb(r * 255 / 3, g * 255 / 3, b * 255 / 2);
|
||||
qFill(customRgb, customRgb + CustomColorCount, 0xffffffff);
|
||||
std::fill(customRgb, customRgb + CustomColorCount, 0xffffffff);
|
||||
readSettings();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
#include "qoutlinemapper_p.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <qvarlengtharray.h>
|
||||
|
|
@ -1853,7 +1854,7 @@ static bool splitPolygon(const QPointF *points, int pointCount, QVector<QPointF>
|
|||
for (int i = 0; i < pointCount; ++i)
|
||||
sorted << points + i;
|
||||
|
||||
qSort(sorted.begin(), sorted.end(), isAbove);
|
||||
std::sort(sorted.begin(), sorted.end(), isAbove);
|
||||
|
||||
qreal splitY = sorted.at(sorted.size() / 2)->y();
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
#include <private/qdatabuffer_p.h>
|
||||
#include <private/qnumeric_p.h>
|
||||
#include <qmath.h>
|
||||
#include <algorithm>
|
||||
|
||||
/**
|
||||
The algorithm is as follows:
|
||||
|
|
@ -824,7 +825,7 @@ void QWingedEdge::intersectAndAdd()
|
|||
}
|
||||
}
|
||||
|
||||
qSort(intersections.data(), intersections.data() + intersections.size());
|
||||
std::sort(intersections.data(), intersections.data() + intersections.size());
|
||||
|
||||
int first = m_segments.segmentAt(i).va;
|
||||
int second = m_segments.segmentAt(i).vb;
|
||||
|
|
@ -1651,7 +1652,7 @@ bool QPathClipper::doClip(QWingedEdge &list, ClipperMode mode)
|
|||
for (int i = 0; i < list.vertexCount(); ++i)
|
||||
y_coords << list.vertex(i)->y;
|
||||
|
||||
qSort(y_coords.begin(), y_coords.end());
|
||||
std::sort(y_coords.begin(), y_coords.end());
|
||||
y_coords.resize(qRemoveDuplicates(y_coords.begin(), y_coords.end(), fuzzyCompare) - y_coords.begin());
|
||||
|
||||
#ifdef QDEBUG_CLIPPER
|
||||
|
|
@ -1827,7 +1828,7 @@ bool QPathClipper::handleCrossingEdges(QWingedEdge &list, qreal y, ClipperMode m
|
|||
QVector<QCrossingEdge> crossings = findCrossings(list, y);
|
||||
|
||||
Q_ASSERT(!crossings.isEmpty());
|
||||
qSort(crossings.begin(), crossings.end());
|
||||
std::sort(crossings.begin(), crossings.end());
|
||||
|
||||
int windingA = 0;
|
||||
int windingB = 0;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
#include <private/qdatabuffer_p.h>
|
||||
#include <private/qdrawhelper_p.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
typedef int Q16Dot16;
|
||||
|
|
@ -326,7 +328,7 @@ void qScanConvert(QScanConverter &d, T allVertical)
|
|||
d.m_active.reset();
|
||||
return;
|
||||
}
|
||||
qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder));
|
||||
std::sort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder));
|
||||
int line = 0;
|
||||
for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) {
|
||||
for (; line < d.m_lines.size() && d.m_lines.at(line).top == y; ++line) {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
// #define QFONTDATABASE_DEBUG
|
||||
|
|
@ -1119,7 +1120,7 @@ QList<QFontDatabase::WritingSystem> QFontDatabase::writingSystems() const
|
|||
list.append(writingSystem);
|
||||
}
|
||||
}
|
||||
qSort(list);
|
||||
std::sort(list.begin(), list.end());
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -1411,7 +1412,7 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
|
|||
if (smoothScalable)
|
||||
return standardSizes();
|
||||
|
||||
qSort(sizes);
|
||||
std::sort(sizes.begin(), sizes.end());
|
||||
return sizes;
|
||||
}
|
||||
|
||||
|
|
@ -1514,7 +1515,7 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
|
|||
if (smoothScalable)
|
||||
return QFontDatabase::standardSizes();
|
||||
|
||||
qSort(sizes);
|
||||
std::sort(sizes.begin(), sizes.end());
|
||||
return sizes;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@
|
|||
#include <qendian.h>
|
||||
#include <private/qharfbuzz_p.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static inline bool qtransform_equals_no_translate(const QTransform &a, const QTransform &b)
|
||||
|
|
@ -969,7 +971,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor)
|
|||
}
|
||||
}
|
||||
end:
|
||||
qSort(kerning_pairs);
|
||||
std::sort(kerning_pairs.begin(), kerning_pairs.end());
|
||||
// for (int i = 0; i < kerning_pairs.count(); ++i)
|
||||
// qDebug() << 'i' << i << "left_right" << hex << kerning_pairs.at(i).left_right;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
|
||||
#include "qfontsubset_agl.cpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
// This map is used for symbol fonts to get the correct glyph names for the latin range
|
||||
|
|
@ -998,7 +1000,7 @@ static QList<QTtfTable> generateGlyphTables(qttf_font_tables &tables, const QLis
|
|||
{
|
||||
const int max_size_small = 65536*2;
|
||||
QList<QTtfGlyph> glyphs = _glyphs;
|
||||
qSort(glyphs);
|
||||
std::sort(glyphs.begin(), glyphs.end());
|
||||
|
||||
Q_ASSERT(tables.maxp.numGlyphs == glyphs.at(glyphs.size()-1).index + 1);
|
||||
int nGlyphs = tables.maxp.numGlyphs;
|
||||
|
|
@ -1076,7 +1078,7 @@ static QByteArray bindFont(const QList<QTtfTable>& _tables)
|
|||
{
|
||||
QList<QTtfTable> tables = _tables;
|
||||
|
||||
qSort(tables);
|
||||
std::sort(tables.begin(), tables.end());
|
||||
|
||||
QByteArray font;
|
||||
const int header_size = sizeof(qint32) + 4*sizeof(quint16);
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@
|
|||
#include "qtextdocumentfragment_p.h"
|
||||
#include "qtextodfwriter_p.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QTextDocumentWriterPrivate
|
||||
|
|
@ -366,7 +368,7 @@ QList<QByteArray> QTextDocumentWriter::supportedDocumentFormats()
|
|||
answer << "ODF";
|
||||
#endif // QT_NO_TEXTODFWRITER
|
||||
|
||||
qSort(answer);
|
||||
std::sort(answer.begin(), answer.end());
|
||||
return answer;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2770,10 +2770,10 @@ void QTextEngine::resolveAdditionalFormats() const
|
|||
addFormatSortedByStart.append(i);
|
||||
}
|
||||
QVarLengthArray<int, 64> addFormatSortedByEnd = addFormatSortedByStart;
|
||||
qSort(addFormatSortedByStart.begin(), addFormatSortedByStart.end(),
|
||||
FormatRangeComparatorByStart(specialData->addFormats));
|
||||
qSort(addFormatSortedByEnd.begin(), addFormatSortedByEnd.end(),
|
||||
FormatRangeComparatorByEnd(specialData->addFormats));
|
||||
std::sort(addFormatSortedByStart.begin(), addFormatSortedByStart.end(),
|
||||
FormatRangeComparatorByStart(specialData->addFormats));
|
||||
std::sort(addFormatSortedByEnd.begin(), addFormatSortedByEnd.end(),
|
||||
FormatRangeComparatorByEnd(specialData->addFormats));
|
||||
|
||||
QVarLengthArray<int, 16> currentFormats;
|
||||
const int *startIt = addFormatSortedByStart.constBegin();
|
||||
|
|
|
|||
Loading…
Reference in New Issue