summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-03 00:04:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-05 23:20:09 +0200
commitaa3f358d433ec7fbe0237141c22297f3d8d4120d (patch)
tree924e0f4387f601cf1183d0dbfa5433f641dc7a96
parent50a8a5e7959ca315e812413661a76576b7c3bbb8 (diff)
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>
-rw-r--r--src/gui/image/qimagereader.cpp6
-rw-r--r--src/gui/image/qimagewriter.cpp6
-rw-r--r--src/gui/image/qpicture.cpp4
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp5
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp3
-rw-r--r--src/gui/painting/qpathclipper.cpp7
-rw-r--r--src/gui/painting/qrasterizer.cpp4
-rw-r--r--src/gui/text/qfontdatabase.cpp7
-rw-r--r--src/gui/text/qfontengine.cpp4
-rw-r--r--src/gui/text/qfontsubset.cpp6
-rw-r--r--src/gui/text/qtextdocumentwriter.cpp4
-rw-r--r--src/gui/text/qtextengine.cpp8
13 files changed, 44 insertions, 24 deletions
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 830428c8f0..5c5b1fa0be 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -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;
}
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index a27dc9d16f..c502a01df5 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -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;
}
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index 1071ed754b..e7fbb2a6a9 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -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;
}
diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp
index d5d742c9b3..955d72f2ca 100644
--- a/src/gui/itemmodels/qstandarditemmodel.cpp
+++ b/src/gui/itemmodels/qstandarditemmodel.cpp
@@ -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;
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 404700292c..f297236655 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -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();
}
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 7112380043..3586b3452a 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -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();
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index 243c99e671..61a6587233 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -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;
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 197d49369e..a7e7d89ec4 100644
--- a/src/gui/painting/qrasterizer.cpp
+++ b/src/gui/painting/qrasterizer.cpp
@@ -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) {
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 97ac604197..6da103e931 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -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;
}
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index d8a8e34b0b..9e6b8d6ffd 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -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;
}
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp
index 3c39272d11..01ae5888e2 100644
--- a/src/gui/text/qfontsubset.cpp
+++ b/src/gui/text/qfontsubset.cpp
@@ -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);
diff --git a/src/gui/text/qtextdocumentwriter.cpp b/src/gui/text/qtextdocumentwriter.cpp
index b4a4a07c42..a294bceacc 100644
--- a/src/gui/text/qtextdocumentwriter.cpp
+++ b/src/gui/text/qtextdocumentwriter.cpp
@@ -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;
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 4c2ca61d39..7a12b241e8 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -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();