summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsak Fyksen <[email protected]>2024-10-17 14:11:12 +0200
committerMarc Mutz <[email protected]>2025-01-09 12:32:34 +0000
commit71d114588d9312e89195a32357ec402fc22b062e (patch)
treeffd044b1f3f5e1612c34083471a3bc8aff45f17d
parent78b6969f1b5d5f5617db26b0cc93b4883c32a826 (diff)
Replace all QPair/qMakePair with std::pair in qtbase/widgets
As a drive-by replace QList::append and operator<< with emplace_back, to avoid repeating value_type. Task-number: QTBUG-115841 Pick-to: 6.9 6.8 Change-Id: I6fb790f959b41b0feb49e3a0f0b6b3631e24a232 Reviewed-by: Marc Mutz <[email protected]>
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp10
-rw-r--r--src/widgets/accessible/qaccessiblewidget.h2
-rw-r--r--src/widgets/accessible/qaccessiblewidgets.cpp6
-rw-r--r--src/widgets/accessible/simplewidgets.cpp12
-rw-r--r--src/widgets/accessible/simplewidgets_p.h4
-rw-r--r--src/widgets/graphicsview/qgraph_p.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp74
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.cpp37
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.h10
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/widgets/graphicsview/qsimplex_p.h3
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp10
-rw-r--r--src/widgets/itemviews/qlistwidget_p.h8
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp16
-rw-r--r--src/widgets/itemviews/qtablewidget_p.h8
-rw-r--r--src/widgets/itemviews/qtreeview.cpp20
-rw-r--r--src/widgets/itemviews/qtreeview_p.h6
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp12
-rw-r--r--src/widgets/itemviews/qtreewidget_p.h9
-rw-r--r--src/widgets/kernel/qapplication.cpp4
21 files changed, 134 insertions, 131 deletions
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index a8d800773dd..6c6aadcb10f 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -252,10 +252,10 @@ static inline bool isAncestor(const QObject *obj, const QObject *child)
}
/*! \reimp */
-QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
+QList<std::pair<QAccessibleInterface *, QAccessible::Relation>>
QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRelations*/) const
{
- QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels;
+ QList<std::pair<QAccessibleInterface *, QAccessible::Relation>> rels;
if (match & QAccessible::Label) {
const QAccessible::Relation rel = QAccessible::Label;
if (QWidget *parent = widget()->parentWidget()) {
@@ -268,7 +268,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
if (QLabel *labelSibling = qobject_cast<QLabel*>(kid)) {
if (labelSibling->buddy() == widget()) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(labelSibling);
- rels.append(qMakePair(iface, rel));
+ rels.emplace_back(iface, rel);
}
}
}
@@ -277,7 +277,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
QGroupBox *groupbox = qobject_cast<QGroupBox*>(parent);
if (groupbox && !groupbox->title().isEmpty()) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(groupbox);
- rels.append(qMakePair(iface, rel));
+ rels.emplace_back(iface, rel);
}
#endif
}
@@ -297,7 +297,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
const QAccessible::Relation rel = QAccessible::Controlled;
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(allReceivers.at(i));
if (iface)
- rels.append(qMakePair(iface, rel));
+ rels.emplace_back(iface, rel);
}
}
diff --git a/src/widgets/accessible/qaccessiblewidget.h b/src/widgets/accessible/qaccessiblewidget.h
index c237e25d4a8..38c4cf6ef43 100644
--- a/src/widgets/accessible/qaccessiblewidget.h
+++ b/src/widgets/accessible/qaccessiblewidget.h
@@ -23,7 +23,7 @@ public:
QWindow *window() const override;
int childCount() const override;
int indexOfChild(const QAccessibleInterface *child) const override;
- QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
+ QList<std::pair<QAccessibleInterface *, QAccessible::Relation>>
relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
QAccessibleInterface *focusChild() const override;
diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp
index 5c2a3bd02b8..536c94e4203 100644
--- a/src/widgets/accessible/qaccessiblewidgets.cpp
+++ b/src/widgets/accessible/qaccessiblewidgets.cpp
@@ -953,7 +953,7 @@ QString QAccessibleTextWidget::textBeforeOffset(int offset, QAccessible::TextBou
QTextCursor cursor = textCursor();
cursor.setPosition(offset);
- QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
+ std::pair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
cursor.setPosition(boundaries.first - 1);
boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
@@ -972,7 +972,7 @@ QString QAccessibleTextWidget::textAfterOffset(int offset, QAccessible::TextBoun
QTextCursor cursor = textCursor();
cursor.setPosition(offset);
- QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
+ std::pair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
cursor.setPosition(boundaries.second);
boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
@@ -990,7 +990,7 @@ QString QAccessibleTextWidget::textAtOffset(int offset, QAccessible::TextBoundar
QTextCursor cursor = textCursor();
cursor.setPosition(offset);
- QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
+ std::pair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);
*startOffset = boundaries.first;
*endOffset = boundaries.second;
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index c762a8d0689..ac49e17b450 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -486,17 +486,17 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
}
/*! \reimp */
-QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
+QList<std::pair<QAccessibleInterface *, QAccessible::Relation>>
QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const
{
- QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels =
+ QList<std::pair<QAccessibleInterface *, QAccessible::Relation>> rels =
QAccessibleWidget::relations(match);
# if QT_CONFIG(shortcut) && QT_CONFIG(label)
if (match & QAccessible::Labelled) {
if (QLabel *label = qobject_cast<QLabel*>(object())) {
const QAccessible::Relation rel = QAccessible::Labelled;
if (QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(label->buddy()))
- rels.append(qMakePair(iface, rel));
+ rels.emplace_back(iface, rel);
}
}
#endif
@@ -598,10 +598,10 @@ QAccessible::Role QAccessibleGroupBox::role() const
return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
}
-QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
+QList<std::pair<QAccessibleInterface *, QAccessible::Relation>>
QAccessibleGroupBox::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const
{
- QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels =
+ QList<std::pair<QAccessibleInterface *, QAccessible::Relation>> rels =
QAccessibleWidget::relations(match);
if ((match & QAccessible::Labelled) && (!groupBox()->title().isEmpty())) {
@@ -609,7 +609,7 @@ QAccessibleGroupBox::relations(QAccessible::Relation match /* = QAccessible::All
for (QWidget *kid : kids) {
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(kid);
if (iface)
- rels.append(qMakePair(iface, QAccessible::Relation(QAccessible::Labelled)));
+ rels.emplace_back(iface, QAccessible::Relation(QAccessible::Labelled));
}
}
return rels;
diff --git a/src/widgets/accessible/simplewidgets_p.h b/src/widgets/accessible/simplewidgets_p.h
index c9c03b00d8c..165ab4009b2 100644
--- a/src/widgets/accessible/simplewidgets_p.h
+++ b/src/widgets/accessible/simplewidgets_p.h
@@ -83,7 +83,7 @@ public:
QAccessible::Role role() const override;
QAccessible::State state() const override;
- QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
+ QList<std::pair<QAccessibleInterface *, QAccessible::Relation>>
relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
void *interface_cast(QAccessible::InterfaceType t) override;
@@ -103,7 +103,7 @@ public:
QAccessible::Role role() const override;
QString text(QAccessible::Text t) const override;
- QList<QPair<QAccessibleInterface *, QAccessible::Relation>>
+ QList<std::pair<QAccessibleInterface *, QAccessible::Relation>>
relations(QAccessible::Relation match = QAccessible::AllRelations) const override;
//QAccessibleActionInterface
diff --git a/src/widgets/graphicsview/qgraph_p.h b/src/widgets/graphicsview/qgraph_p.h
index 10c742d42ef..9abd0e567c0 100644
--- a/src/widgets/graphicsview/qgraph_p.h
+++ b/src/widgets/graphicsview/qgraph_p.h
@@ -179,15 +179,15 @@ public:
return setOfVertices;
}
- QList<QPair<Vertex *, Vertex *>> connections() const
+ QList<std::pair<Vertex *, Vertex *>> connections() const
{
- QList<QPair<Vertex *, Vertex *>> conns;
+ QList<std::pair<Vertex *, Vertex *>> conns;
for (const_iterator it = constBegin(); it != constEnd(); ++it) {
Vertex *from = it.from();
Vertex *to = it.to();
// do not return (from,to) *and* (to,from)
if (std::less<Vertex*>()(from, to))
- conns.append(qMakePair(from, to));
+ conns.emplace_back(from, to);
}
return conns;
}
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
index 8a5280d44cc..2436f2c7366 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -378,9 +378,9 @@ bool ParallelAnchorData::calculateSizeHints()
0 is at Preferred
1 is at Maximum
*/
-static QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> getFactor(qreal value, qreal min,
- qreal minPref, qreal pref,
- qreal maxPref, qreal max)
+static std::pair<QGraphicsAnchorLayoutPrivate::Interval, qreal> getFactor(qreal value, qreal min,
+ qreal minPref, qreal pref,
+ qreal maxPref, qreal max)
{
QGraphicsAnchorLayoutPrivate::Interval interval;
qreal lower;
@@ -411,10 +411,10 @@ static QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> getFactor(qreal valu
progress = (value - lower) / (upper - lower);
}
- return qMakePair(interval, progress);
+ return std::pair(interval, progress);
}
-static qreal interpolate(const QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> &factor,
+static qreal interpolate(const std::pair<QGraphicsAnchorLayoutPrivate::Interval, qreal> &factor,
qreal min, qreal minPref, qreal pref, qreal maxPref, qreal max)
{
qreal lower = 0;
@@ -447,11 +447,11 @@ void SequentialAnchorData::updateChildrenSizes()
// Band here refers if the value is in the Minimum To Preferred
// band (the lower band) or the Preferred To Maximum (the upper band).
- const QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> minFactor =
+ const std::pair<QGraphicsAnchorLayoutPrivate::Interval, qreal> minFactor =
getFactor(sizeAtMinimum, minSize, minPrefSize, prefSize, maxPrefSize, maxSize);
- const QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> prefFactor =
+ const std::pair<QGraphicsAnchorLayoutPrivate::Interval, qreal> prefFactor =
getFactor(sizeAtPreferred, minSize, minPrefSize, prefSize, maxPrefSize, maxSize);
- const QPair<QGraphicsAnchorLayoutPrivate::Interval, qreal> maxFactor =
+ const std::pair<QGraphicsAnchorLayoutPrivate::Interval, qreal> maxFactor =
getFactor(sizeAtMaximum, minSize, minPrefSize, prefSize, maxPrefSize, maxSize);
// XXX This is not safe if Vertex simplification takes place after the sequential
@@ -982,14 +982,14 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(Qt::Orientation orient
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
QSet<AnchorVertex *> visited;
- QStack<QPair<AnchorVertex *, AnchorVertex *> > stack;
- stack.push(qMakePair(static_cast<AnchorVertex *>(nullptr), layoutFirstVertex[orientation]));
+ QStack<std::pair<AnchorVertex *, AnchorVertex *> > stack;
+ stack.push(std::pair(static_cast<AnchorVertex *>(nullptr), layoutFirstVertex[orientation]));
QList<AnchorVertex *> candidates;
// Walk depth-first, in the stack we store start of the candidate sequence (beforeSequence)
// and the vertex to be visited.
while (!stack.isEmpty()) {
- QPair<AnchorVertex *, AnchorVertex *> pair = stack.pop();
+ std::pair<AnchorVertex *, AnchorVertex *> pair = stack.pop();
AnchorVertex *beforeSequence = pair.first;
AnchorVertex *v = pair.second;
@@ -1065,9 +1065,9 @@ bool QGraphicsAnchorLayoutPrivate::simplifyGraphIteration(Qt::Orientation orient
// vertex. If it's not an end of sequence, we keep the original 'before' vertex,
// since we are keeping the candidates list.
if (endOfSequence)
- stack.push(qMakePair(v, next));
+ stack.push(std::pair(v, next));
else
- stack.push(qMakePair(beforeSequence, next));
+ stack.push(std::pair(beforeSequence, next));
}
visited.insert(v);
@@ -1212,7 +1212,7 @@ void QGraphicsAnchorLayoutPrivate::restoreSimplifiedGraph(Qt::Orientation orient
// Restore anchor simplification
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
- QList<QPair<AnchorVertex *, AnchorVertex *>> connections = g.connections();
+ QList<std::pair<AnchorVertex *, AnchorVertex *>> connections = g.connections();
for (int i = 0; i < connections.size(); ++i) {
AnchorVertex *v1 = connections.at(i).first;
AnchorVertex *v2 = connections.at(i).second;
@@ -1764,12 +1764,12 @@ void QGraphicsAnchorLayoutPrivate::removeAnchor(AnchorVertex *firstVertex,
bool keepFirstItem = false;
bool keepSecondItem = false;
- QPair<AnchorVertex *, int> v;
+ std::pair<AnchorVertex *, int> v;
int refcount = -1;
if (firstItem != q) {
for (int i = Qt::AnchorLeft; i <= Qt::AnchorBottom; ++i) {
- v = m_vertexList.value(qMakePair(firstItem, static_cast<Qt::AnchorPoint>(i)));
+ v = m_vertexList.value(std::pair(firstItem, static_cast<Qt::AnchorPoint>(i)));
if (v.first) {
if (i == Qt::AnchorHorizontalCenter || i == Qt::AnchorVerticalCenter)
refcount = 2;
@@ -1787,7 +1787,7 @@ void QGraphicsAnchorLayoutPrivate::removeAnchor(AnchorVertex *firstVertex,
if (secondItem != q) {
for (int i = Qt::AnchorLeft; i <= Qt::AnchorBottom; ++i) {
- v = m_vertexList.value(qMakePair(secondItem, static_cast<Qt::AnchorPoint>(i)));
+ v = m_vertexList.value(std::pair(secondItem, static_cast<Qt::AnchorPoint>(i)));
if (v.first) {
if (i == Qt::AnchorHorizontalCenter || i == Qt::AnchorVerticalCenter)
refcount = 2;
@@ -1835,8 +1835,8 @@ void QGraphicsAnchorLayoutPrivate::removeAnchor_helper(AnchorVertex *v1, AnchorV
AnchorVertex *QGraphicsAnchorLayoutPrivate::addInternalVertex(QGraphicsLayoutItem *item,
Qt::AnchorPoint edge)
{
- QPair<QGraphicsLayoutItem *, Qt::AnchorPoint> pair(item, edge);
- QPair<AnchorVertex *, int> v = m_vertexList.value(pair);
+ std::pair<QGraphicsLayoutItem *, Qt::AnchorPoint> pair(item, edge);
+ std::pair<AnchorVertex *, int> v = m_vertexList.value(pair);
if (!v.first) {
Q_ASSERT(v.second == 0);
@@ -1856,8 +1856,8 @@ AnchorVertex *QGraphicsAnchorLayoutPrivate::addInternalVertex(QGraphicsLayoutIte
void QGraphicsAnchorLayoutPrivate::removeInternalVertex(QGraphicsLayoutItem *item,
Qt::AnchorPoint edge)
{
- QPair<QGraphicsLayoutItem *, Qt::AnchorPoint> pair(item, edge);
- QPair<AnchorVertex *, int> v = m_vertexList.value(pair);
+ std::pair<QGraphicsLayoutItem *, Qt::AnchorPoint> pair(item, edge);
+ std::pair<AnchorVertex *, int> v = m_vertexList.value(pair);
if (!v.first) {
qWarning("This item with this edge is not in the graph");
@@ -2234,7 +2234,7 @@ bool QGraphicsAnchorLayoutPrivate::calculateNonTrunk(const QList<QSimplexConstra
void QGraphicsAnchorLayoutPrivate::refreshAllSizeHints(Qt::Orientation orientation)
{
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
- QList<QPair<AnchorVertex *, AnchorVertex *>> vertices = g.connections();
+ QList<std::pair<AnchorVertex *, AnchorVertex *>> vertices = g.connections();
QLayoutStyleInfo styleInf = styleInfo();
for (int i = 0; i < vertices.size(); ++i) {
@@ -2255,7 +2255,7 @@ void QGraphicsAnchorLayoutPrivate::refreshAllSizeHints(Qt::Orientation orientati
*/
void QGraphicsAnchorLayoutPrivate::findPaths(Qt::Orientation orientation)
{
- QQueue<QPair<AnchorVertex *, AnchorVertex *> > queue;
+ QQueue<std::pair<AnchorVertex *, AnchorVertex *> > queue;
QSet<AnchorData *> visited;
@@ -2265,10 +2265,10 @@ void QGraphicsAnchorLayoutPrivate::findPaths(Qt::Orientation orientation)
const auto adjacentVertices = graph[orientation].adjacentVertices(root);
for (AnchorVertex *v : adjacentVertices)
- queue.enqueue(qMakePair(root, v));
+ queue.enqueue(std::pair(root, v));
while(!queue.isEmpty()) {
- QPair<AnchorVertex *, AnchorVertex *> pair = queue.dequeue();
+ std::pair<AnchorVertex *, AnchorVertex *> pair = queue.dequeue();
AnchorData *edge = graph[orientation].edgeData(pair.first, pair.second);
if (visited.contains(edge))
@@ -2286,7 +2286,7 @@ void QGraphicsAnchorLayoutPrivate::findPaths(Qt::Orientation orientation)
const auto adjacentVertices = graph[orientation].adjacentVertices(pair.second);
for (AnchorVertex *v : adjacentVertices)
- queue.enqueue(qMakePair(pair.second, v));
+ queue.enqueue(std::pair(pair.second, v));
}
// We will walk through every reachable items (non-float) store them in a temporary set.
@@ -2327,7 +2327,7 @@ void QGraphicsAnchorLayoutPrivate::constraintsFromPaths(Qt::Orientation orientat
void QGraphicsAnchorLayoutPrivate::updateAnchorSizes(Qt::Orientation orientation)
{
Graph<AnchorVertex, AnchorData> &g = graph[orientation];
- const QList<QPair<AnchorVertex *, AnchorVertex *>> &vertices = g.connections();
+ const QList<std::pair<AnchorVertex *, AnchorVertex *>> &vertices = g.connections();
for (int i = 0; i < vertices.size(); ++i) {
AnchorData *ad = g.edgeData(vertices.at(i).first, vertices.at(i).second);
@@ -2622,7 +2622,7 @@ void QGraphicsAnchorLayoutPrivate::setItemsGeometries(const QRectF &geom)
*/
void QGraphicsAnchorLayoutPrivate::calculateVertexPositions(Qt::Orientation orientation)
{
- QQueue<QPair<AnchorVertex *, AnchorVertex *> > queue;
+ QQueue<std::pair<AnchorVertex *, AnchorVertex *> > queue;
QSet<AnchorVertex *> visited;
// Get root vertex
@@ -2634,14 +2634,14 @@ void QGraphicsAnchorLayoutPrivate::calculateVertexPositions(Qt::Orientation orie
// Add initial edges to the queue
const auto adjacentVertices = graph[orientation].adjacentVertices(root);
for (AnchorVertex *v : adjacentVertices)
- queue.enqueue(qMakePair(root, v));
+ queue.enqueue(std::pair(root, v));
// Do initial calculation required by "interpolateEdge()"
setupEdgesInterpolation(orientation);
// Traverse the graph and calculate vertex positions
while (!queue.isEmpty()) {
- QPair<AnchorVertex *, AnchorVertex *> pair = queue.dequeue();
+ std::pair<AnchorVertex *, AnchorVertex *> pair = queue.dequeue();
AnchorData *edge = graph[orientation].edgeData(pair.first, pair.second);
if (visited.contains(pair.second))
@@ -2653,7 +2653,7 @@ void QGraphicsAnchorLayoutPrivate::calculateVertexPositions(Qt::Orientation orie
QList<AnchorVertex *> adjacents = graph[orientation].adjacentVertices(pair.second);
for (int i = 0; i < adjacents.size(); ++i) {
if (!visited.contains(adjacents.at(i)))
- queue.enqueue(qMakePair(pair.second, adjacents.at(i)));
+ queue.enqueue(std::pair(pair.second, adjacents.at(i)));
}
}
}
@@ -2673,7 +2673,7 @@ void QGraphicsAnchorLayoutPrivate::setupEdgesInterpolation(
qreal current;
current = (orientation == Qt::Horizontal) ? q->contentsRect().width() : q->contentsRect().height();
- QPair<Interval, qreal> result;
+ std::pair<Interval, qreal> result;
result = getFactor(current,
sizeHints[orientation][Qt::MinimumSize],
sizeHints[orientation][Qt::PreferredSize],
@@ -2703,8 +2703,8 @@ void QGraphicsAnchorLayoutPrivate::setupEdgesInterpolation(
void QGraphicsAnchorLayoutPrivate::interpolateEdge(AnchorVertex *base, AnchorData *edge)
{
const Qt::Orientation orientation = edge->isVertical ? Qt::Vertical : Qt::Horizontal;
- const QPair<Interval, qreal> factor(interpolationInterval[orientation],
- interpolationProgress[orientation]);
+ const std::pair<Interval, qreal> factor(interpolationInterval[orientation],
+ interpolationProgress[orientation]);
qreal edgeDistance = interpolate(factor, edge->sizeAtMinimum, edge->sizeAtPreferred,
edge->sizeAtPreferred, edge->sizeAtPreferred,
@@ -2761,7 +2761,7 @@ bool QGraphicsAnchorLayoutPrivate::solveMinMax(const QList<QSimplexConstraint *>
}
enum slackType { Grower = -1, Shrinker = 1 };
-static QPair<QSimplexVariable *, QSimplexConstraint *> createSlack(QSimplexConstraint *sizeConstraint,
+static std::pair<QSimplexVariable *, QSimplexConstraint *> createSlack(QSimplexConstraint *sizeConstraint,
qreal interval, slackType type)
{
QSimplexVariable *slack = new QSimplexVariable;
@@ -2772,7 +2772,7 @@ static QPair<QSimplexVariable *, QSimplexConstraint *> createSlack(QSimplexConst
limit->ratio = QSimplexConstraint::LessOrEqual;
limit->constant = interval;
- return qMakePair(slack, limit);
+ return std::pair(slack, limit);
}
bool QGraphicsAnchorLayoutPrivate::solvePreferred(const QList<QSimplexConstraint *> &constraints,
@@ -2815,7 +2815,7 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(const QList<QSimplexConstraint
sizeConstraint->constant = ad->prefSize + g_offset;
// Can easily shrink
- QPair<QSimplexVariable *, QSimplexConstraint *> slack;
+ std::pair<QSimplexVariable *, QSimplexConstraint *> slack;
const qreal softShrinkInterval = ad->prefSize - ad->minPrefSize;
if (softShrinkInterval) {
slack = createSlack(sizeConstraint, softShrinkInterval, Shrinker);
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
index 880e262d348..3a049105b9d 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
@@ -475,14 +475,14 @@ public:
void identifyFloatItems(const QSet<AnchorData *> &visited, Qt::Orientation orientation);
void identifyNonFloatItems_helper(const AnchorData *ad, QSet<QGraphicsLayoutItem *> *nonFloatingItemsIdentifiedSoFar);
- inline AnchorVertex *internalVertex(const QPair<QGraphicsLayoutItem*, Qt::AnchorPoint> &itemEdge) const
+ inline AnchorVertex *internalVertex(const std::pair<QGraphicsLayoutItem*, Qt::AnchorPoint> &itemEdge) const
{
return m_vertexList.value(itemEdge).first;
}
inline AnchorVertex *internalVertex(const QGraphicsLayoutItem *item, Qt::AnchorPoint edge) const
{
- return internalVertex(qMakePair(const_cast<QGraphicsLayoutItem *>(item), edge));
+ return internalVertex(std::pair(const_cast<QGraphicsLayoutItem *>(item), edge));
}
inline void changeLayoutVertex(Qt::Orientation orientation, AnchorVertex *oldV, AnchorVertex *newV)
@@ -528,7 +528,7 @@ public:
// Mapping between high level anchorage points (Item, Edge) to low level
// ones (Graph Vertices)
- QHash<QPair<QGraphicsLayoutItem*, Qt::AnchorPoint>, QPair<AnchorVertex *, int> > m_vertexList;
+ QHash<std::pair<QGraphicsLayoutItem*, Qt::AnchorPoint>, std::pair<AnchorVertex *, int> > m_vertexList;
// Internal graph of anchorage points and anchors, for both orientations
QHVContainer<Graph<AnchorVertex, AnchorData>> graph;
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.cpp b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
index 23dd9fcc7df..d6ed02d798f 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.cpp
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
@@ -50,7 +50,6 @@
#include <QtCore/qtimeline.h>
#include <QtCore/qpoint.h>
#include <QtCore/qpointer.h>
-#include <QtCore/qpair.h>
#include <algorithm>
@@ -248,13 +247,14 @@ void QGraphicsItemAnimation::setPosAt(qreal step, const QPointF &pos)
\sa posAt(), setPosAt()
*/
-QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::posList() const
+QList<std::pair<qreal, QPointF> > QGraphicsItemAnimation::posList() const
{
- QList<QPair<qreal, QPointF> > list;
+ QList<std::pair<qreal, QPointF>> list;
const int xPosCount = d->xPosition.size();
list.reserve(xPosCount);
for (int i = 0; i < xPosCount; ++i)
- list << QPair<qreal, QPointF>(d->xPosition.at(i).step, QPointF(d->xPosition.at(i).value, d->yPosition.at(i).value));
+ list.emplace_back(d->xPosition.at(i).step,
+ QPointF(d->xPosition.at(i).value, d->yPosition.at(i).value));
return list;
}
@@ -306,13 +306,13 @@ void QGraphicsItemAnimation::setRotationAt(qreal step, qreal angle)
\sa rotationAt(), setRotationAt()
*/
-QList<QPair<qreal, qreal> > QGraphicsItemAnimation::rotationList() const
+QList<std::pair<qreal, qreal> > QGraphicsItemAnimation::rotationList() const
{
- QList<QPair<qreal, qreal> > list;
+ QList<std::pair<qreal, qreal>> list;
const int numRotations = d->rotation.size();
list.reserve(numRotations);
for (int i = 0; i < numRotations; ++i)
- list << QPair<qreal, qreal>(d->rotation.at(i).step, d->rotation.at(i).value);
+ list.emplace_back(d->rotation.at(i).step, d->rotation.at(i).value);
return list;
}
@@ -356,13 +356,14 @@ void QGraphicsItemAnimation::setTranslationAt(qreal step, qreal dx, qreal dy)
\sa xTranslationAt(), yTranslationAt(), setTranslationAt()
*/
-QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::translationList() const
+QList<std::pair<qreal, QPointF> > QGraphicsItemAnimation::translationList() const
{
- QList<QPair<qreal, QPointF> > list;
+ QList<std::pair<qreal, QPointF>> list;
const int numTranslations = d->xTranslation.size();
list.reserve(numTranslations);
for (int i = 0; i < numTranslations; ++i)
- list << QPair<qreal, QPointF>(d->xTranslation.at(i).step, QPointF(d->xTranslation.at(i).value, d->yTranslation.at(i).value));
+ list.emplace_back(d->xTranslation.at(i).step,
+ QPointF(d->xTranslation.at(i).value, d->yTranslation.at(i).value));
return list;
}
@@ -407,13 +408,15 @@ void QGraphicsItemAnimation::setScaleAt(qreal step, qreal sx, qreal sy)
\sa verticalScaleAt(), horizontalScaleAt(), setScaleAt()
*/
-QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::scaleList() const
+QList<std::pair<qreal, QPointF> > QGraphicsItemAnimation::scaleList() const
{
- QList<QPair<qreal, QPointF> > list;
+ QList<std::pair<qreal, QPointF>> list;
const int numScales = d->horizontalScale.size();
list.reserve(numScales);
for (int i = 0; i < numScales; ++i)
- list << QPair<qreal, QPointF>(d->horizontalScale.at(i).step, QPointF(d->horizontalScale.at(i).value, d->verticalScale.at(i).value));
+ list.emplace_back(d->horizontalScale.at(i).step,
+ QPointF(d->horizontalScale.at(i).value,
+ d->verticalScale.at(i).value));
return list;
}
@@ -457,13 +460,15 @@ void QGraphicsItemAnimation::setShearAt(qreal step, qreal sh, qreal sv)
\sa verticalShearAt(), horizontalShearAt(), setShearAt()
*/
-QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::shearList() const
+QList<std::pair<qreal, QPointF> > QGraphicsItemAnimation::shearList() const
{
- QList<QPair<qreal, QPointF> > list;
+ QList<std::pair<qreal, QPointF>> list;
const int numShears = d->horizontalShear.size();
list.reserve(numShears);
for (int i = 0; i < numShears; ++i)
- list << QPair<qreal, QPointF>(d->horizontalShear.at(i).step, QPointF(d->horizontalShear.at(i).value, d->verticalShear.at(i).value));
+ list.emplace_back(d->horizontalShear.at(i).step,
+ QPointF(d->horizontalShear.at(i).value,
+ d->verticalShear.at(i).value));
return list;
}
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.h b/src/widgets/graphicsview/qgraphicsitemanimation.h
index 5fb6484c747..3362faab321 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.h
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.h
@@ -31,28 +31,28 @@ public:
void setTimeLine(QTimeLine *timeLine);
QPointF posAt(qreal step) const;
- QList<QPair<qreal, QPointF> > posList() const;
+ QList<std::pair<qreal, QPointF> > posList() const;
void setPosAt(qreal step, const QPointF &pos);
QTransform transformAt(qreal step) const;
qreal rotationAt(qreal step) const;
- QList<QPair<qreal, qreal> > rotationList() const;
+ QList<std::pair<qreal, qreal> > rotationList() const;
void setRotationAt(qreal step, qreal angle);
qreal xTranslationAt(qreal step) const;
qreal yTranslationAt(qreal step) const;
- QList<QPair<qreal, QPointF> > translationList() const;
+ QList<std::pair<qreal, QPointF> > translationList() const;
void setTranslationAt(qreal step, qreal dx, qreal dy);
qreal verticalScaleAt(qreal step) const;
qreal horizontalScaleAt(qreal step) const;
- QList<QPair<qreal, QPointF> > scaleList() const;
+ QList<std::pair<qreal, QPointF> > scaleList() const;
void setScaleAt(qreal step, qreal sx, qreal sy);
qreal verticalShearAt(qreal step) const;
qreal horizontalShearAt(qreal step) const;
- QList<QPair<qreal, QPointF> > shearList() const;
+ QList<std::pair<qreal, QPointF> > shearList() const;
void setShearAt(qreal step, qreal sh, qreal sv);
void clear();
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index b3b80be12cb..858e81c287c 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -5831,7 +5831,7 @@ int QGraphicsScenePrivate::findClosestTouchPointId(const QPointF &scenePos)
void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent)
{
- typedef QPair<QEventPoint::States, QList<QEventPoint> > StatesAndTouchPoints;
+ typedef std::pair<QEventPoint::States, QList<QEventPoint> > StatesAndTouchPoints;
QHash<QGraphicsItem *, StatesAndTouchPoints> itemsNeedingEvents;
const auto &touchPoints = sceneTouchEvent->points();
diff --git a/src/widgets/graphicsview/qsimplex_p.h b/src/widgets/graphicsview/qsimplex_p.h
index 800c8fe9344..f3efa2eb191 100644
--- a/src/widgets/graphicsview/qsimplex_p.h
+++ b/src/widgets/graphicsview/qsimplex_p.h
@@ -17,7 +17,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qhash.h>
-#include <QtCore/qpair.h>
#include <QtCore/qstring.h>
QT_REQUIRE_CONFIG(graphicsview);
@@ -58,7 +57,7 @@ struct QSimplexConstraint
qreal constant;
Ratio ratio;
- QPair<QSimplexVariable *, qreal> helper;
+ std::pair<QSimplexVariable *, qreal> helper;
QSimplexVariable * artificial;
void invert();
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 45c8491067a..baf7e8afc3a 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -299,7 +299,7 @@ void QListModel::sort(int column, Qt::SortOrder order)
emit layoutAboutToBeChanged({}, QAbstractItemModel::VerticalSortHint);
- QList<QPair<QListWidgetItem *, int>> sorting(items.size());
+ QList<std::pair<QListWidgetItem *, int>> sorting(items.size());
for (int i = 0; i < items.size(); ++i) {
QListWidgetItem *item = items.at(i);
sorting[i].first = item;
@@ -357,14 +357,14 @@ void QListModel::ensureSorted(int column, Qt::SortOrder order, int start, int en
sort(column, order);
}
-bool QListModel::itemLessThan(const QPair<QListWidgetItem*,int> &left,
- const QPair<QListWidgetItem*,int> &right)
+bool QListModel::itemLessThan(const std::pair<QListWidgetItem*,int> &left,
+ const std::pair<QListWidgetItem*,int> &right)
{
return (*left.first) < (*right.first);
}
-bool QListModel::itemGreaterThan(const QPair<QListWidgetItem*,int> &left,
- const QPair<QListWidgetItem*,int> &right)
+bool QListModel::itemGreaterThan(const std::pair<QListWidgetItem*,int> &left,
+ const std::pair<QListWidgetItem*,int> &right)
{
return (*right.first) < (*left.first);
}
diff --git a/src/widgets/itemviews/qlistwidget_p.h b/src/widgets/itemviews/qlistwidget_p.h
index 1007542ddcd..9aa87873fe4 100644
--- a/src/widgets/itemviews/qlistwidget_p.h
+++ b/src/widgets/itemviews/qlistwidget_p.h
@@ -77,10 +77,10 @@ public:
void sort(int column, Qt::SortOrder order) override;
void ensureSorted(int column, Qt::SortOrder order, int start, int end);
- static bool itemLessThan(const QPair<QListWidgetItem*,int> &left,
- const QPair<QListWidgetItem*,int> &right);
- static bool itemGreaterThan(const QPair<QListWidgetItem*,int> &left,
- const QPair<QListWidgetItem*,int> &right);
+ static bool itemLessThan(const std::pair<QListWidgetItem*,int> &left,
+ const std::pair<QListWidgetItem*,int> &right);
+ static bool itemGreaterThan(const std::pair<QListWidgetItem*,int> &left,
+ const std::pair<QListWidgetItem*,int> &right);
static QList<QListWidgetItem*>::iterator sortedInsertionIterator(
const QList<QListWidgetItem*>::iterator &begin,
const QList<QListWidgetItem*>::iterator &end,
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 52efb5060f5..f23904e6fa2 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -496,7 +496,7 @@ Qt::ItemFlags QTableModel::flags(const QModelIndex &index) const
void QTableModel::sort(int column, Qt::SortOrder order)
{
- QList<QPair<QTableWidgetItem *, int>> sortable;
+ QList<std::pair<QTableWidgetItem *, int>> sortable;
QList<int> unsortable;
const int numRows = rowCount();
@@ -505,7 +505,7 @@ void QTableModel::sort(int column, Qt::SortOrder order)
for (int row = 0; row < numRows; ++row) {
if (QTableWidgetItem *itm = item(row, column))
- sortable.append(QPair<QTableWidgetItem*,int>(itm, row));
+ sortable.emplace_back(itm, row);
else
unsortable.append(row);
}
@@ -549,7 +549,7 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
int start, int end)
{
int count = end - start + 1;
- QList<QPair<QTableWidgetItem *, int>> sorting;
+ QList<std::pair<QTableWidgetItem *, int>> sorting;
sorting.reserve(count);
for (int row = start; row <= end; ++row) {
QTableWidgetItem *itm = item(row, column);
@@ -558,7 +558,7 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
// at the end of the table when it is sorted)
break;
}
- sorting.append(QPair<QTableWidgetItem*,int>(itm, row));
+ sorting.emplace_back(itm, row);
}
const auto compare = (order == Qt::AscendingOrder ? &itemLessThan : &itemGreaterThan);
@@ -686,14 +686,14 @@ QTableModel::sortedInsertionIterator(const QList<QTableWidgetItem *>::iterator &
return std::lower_bound(begin, end, item, QTableModelGreaterThan());
}
-bool QTableModel::itemLessThan(const QPair<QTableWidgetItem*,int> &left,
- const QPair<QTableWidgetItem*,int> &right)
+bool QTableModel::itemLessThan(const std::pair<QTableWidgetItem*,int> &left,
+ const std::pair<QTableWidgetItem*,int> &right)
{
return *(left.first) < *(right.first);
}
-bool QTableModel::itemGreaterThan(const QPair<QTableWidgetItem*,int> &left,
- const QPair<QTableWidgetItem*,int> &right)
+bool QTableModel::itemGreaterThan(const std::pair<QTableWidgetItem*,int> &left,
+ const std::pair<QTableWidgetItem*,int> &right)
{
return (*(right.first) < *(left .first));
}
diff --git a/src/widgets/itemviews/qtablewidget_p.h b/src/widgets/itemviews/qtablewidget_p.h
index a9ff92fd126..11b9b42b2f6 100644
--- a/src/widgets/itemviews/qtablewidget_p.h
+++ b/src/widgets/itemviews/qtablewidget_p.h
@@ -103,10 +103,10 @@ public:
Qt::ItemFlags flags(const QModelIndex &index) const override;
void sort(int column, Qt::SortOrder order) override;
- static bool itemLessThan(const QPair<QTableWidgetItem*,int> &left,
- const QPair<QTableWidgetItem*,int> &right);
- static bool itemGreaterThan(const QPair<QTableWidgetItem*,int> &left,
- const QPair<QTableWidgetItem*,int> &right);
+ static bool itemLessThan(const std::pair<QTableWidgetItem*,int> &left,
+ const std::pair<QTableWidgetItem*,int> &right);
+ static bool itemGreaterThan(const std::pair<QTableWidgetItem*,int> &left,
+ const std::pair<QTableWidgetItem*,int> &right);
void ensureSorted(int column, Qt::SortOrder order, int start, int end);
QList<QTableWidgetItem *> columnItems(int column) const;
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 7d85442c2c4..6c7f6817257 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -2758,10 +2758,10 @@ void QTreeView::expandRecursively(const QModelIndex &index, int depth)
expand(index);
if (depth == 0)
return;
- QStack<QPair<QModelIndex, int>> parents;
+ QStack<std::pair<QModelIndex, int>> parents;
parents.push({index, 0});
while (!parents.isEmpty()) {
- const QPair<QModelIndex, int> elem = parents.pop();
+ const std::pair<QModelIndex, int> elem = parents.pop();
const QModelIndex &parent = elem.first;
const int curDepth = elem.second;
const int rowCount = d->model->rowCount(parent);
@@ -3909,8 +3909,8 @@ QRect QTreeViewPrivate::itemDecorationRect(const QModelIndex &index) const
return q->style()->subElementRect(QStyle::SE_TreeViewDisclosureItem, &opt, q);
}
-QList<QPair<int, int>> QTreeViewPrivate::columnRanges(const QModelIndex &topIndex,
- const QModelIndex &bottomIndex) const
+QList<std::pair<int, int>> QTreeViewPrivate::columnRanges(const QModelIndex &topIndex,
+ const QModelIndex &bottomIndex) const
{
const int topVisual = header->visualIndex(topIndex.column()),
bottomVisual = header->visualIndex(bottomIndex.column());
@@ -3930,8 +3930,8 @@ QList<QPair<int, int>> QTreeViewPrivate::columnRanges(const QModelIndex &topInde
//let's sort the list
std::sort(logicalIndexes.begin(), logicalIndexes.end());
- QList<QPair<int, int>> ret;
- QPair<int, int> current;
+ QList<std::pair<int, int>> ret;
+ std::pair<int, int> current;
current.first = -2; // -1 is not enough because -1+1 = 0
current.second = -2;
for(int i = 0; i < logicalIndexes.size(); ++i) {
@@ -3964,8 +3964,8 @@ void QTreeViewPrivate::select(const QModelIndex &topIndex, const QModelIndex &bo
const int top = viewIndex(topIndex),
bottom = viewIndex(bottomIndex);
- const QList<QPair<int, int>> colRanges = columnRanges(topIndex, bottomIndex);
- QList<QPair<int, int>>::const_iterator it;
+ const QList<std::pair<int, int>> colRanges = columnRanges(topIndex, bottomIndex);
+ QList<std::pair<int, int>>::const_iterator it;
for (it = colRanges.begin(); it != colRanges.end(); ++it) {
const int left = (*it).first,
right = (*it).second;
@@ -4016,7 +4016,7 @@ void QTreeViewPrivate::select(const QModelIndex &topIndex, const QModelIndex &bo
q->selectionModel()->select(selection, command);
}
-QPair<int,int> QTreeViewPrivate::startAndEndColumns(const QRect &rect) const
+std::pair<int,int> QTreeViewPrivate::startAndEndColumns(const QRect &rect) const
{
Q_Q(const QTreeView);
int start = header->visualIndexAt(rect.left());
@@ -4028,7 +4028,7 @@ QPair<int,int> QTreeViewPrivate::startAndEndColumns(const QRect &rect) const
start = (start == -1 ? 0 : start);
end = (end == -1 ? header->count() - 1 : end);
}
- return qMakePair(qMin(start, end), qMax(start, end));
+ return std::pair(qMin(start, end), qMax(start, end));
}
bool QTreeViewPrivate::hasVisibleChildren(const QModelIndex& parent) const
diff --git a/src/widgets/itemviews/qtreeview_p.h b/src/widgets/itemviews/qtreeview_p.h
index 7f7045dfb65..d2180018ce3 100644
--- a/src/widgets/itemviews/qtreeview_p.h
+++ b/src/widgets/itemviews/qtreeview_p.h
@@ -139,11 +139,11 @@ public:
int itemDecorationAt(const QPoint &pos) const;
QRect itemDecorationRect(const QModelIndex &index) const;
- QList<QPair<int, int>> columnRanges(const QModelIndex &topIndex,
+ QList<std::pair<int, int>> columnRanges(const QModelIndex &topIndex,
const QModelIndex &bottomIndex) const;
void select(const QModelIndex &start, const QModelIndex &stop, QItemSelectionModel::SelectionFlags command);
- QPair<int,int> startAndEndColumns(const QRect &rect) const;
+ std::pair<int,int> startAndEndColumns(const QRect &rect) const;
void updateChildCount(const int parentItem, const int delta);
@@ -185,7 +185,7 @@ public:
bool customIndent;
// used for drawing
- mutable QPair<int,int> leftAndRight;
+ mutable std::pair<int,int> leftAndRight;
mutable int current;
mutable bool spanning;
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 20be61edc00..bca1fefe07f 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -578,7 +578,7 @@ void QTreeModel::ensureSorted(int column, Qt::SortOrder order,
QList<QTreeWidgetItem*> lst = itm->children;
int count = end - start + 1;
- QList<QPair<QTreeWidgetItem *, int>> sorting(count);
+ QList<std::pair<QTreeWidgetItem *, int>> sorting(count);
for (int i = 0; i < count; ++i) {
sorting[i].first = lst.at(start + i);
sorting[i].second = start + i;
@@ -658,8 +658,8 @@ void QTreeModel::ensureSorted(int column, Qt::SortOrder order,
Used by the sorting functions.
*/
-bool QTreeModel::itemLessThan(const QPair<QTreeWidgetItem*,int> &left,
- const QPair<QTreeWidgetItem*,int> &right)
+bool QTreeModel::itemLessThan(const std::pair<QTreeWidgetItem*,int> &left,
+ const std::pair<QTreeWidgetItem*,int> &right)
{
return *(left.first) < *(right.first);
}
@@ -673,8 +673,8 @@ bool QTreeModel::itemLessThan(const QPair<QTreeWidgetItem*,int> &left,
Used by the sorting functions.
*/
-bool QTreeModel::itemGreaterThan(const QPair<QTreeWidgetItem*,int> &left,
- const QPair<QTreeWidgetItem*,int> &right)
+bool QTreeModel::itemGreaterThan(const std::pair<QTreeWidgetItem*,int> &left,
+ const std::pair<QTreeWidgetItem*,int> &right)
{
return *(right.first) < *(left.first);
}
@@ -825,7 +825,7 @@ void QTreeModel::sortItems(QList<QTreeWidgetItem*> *items, int column, Qt::SortO
return;
// store the original order of indexes
- QList<QPair<QTreeWidgetItem *, int>> sorting(items->size());
+ QList<std::pair<QTreeWidgetItem *, int>> sorting(items->size());
for (int i = 0; i < sorting.size(); ++i) {
sorting[i].first = items->at(i);
sorting[i].second = i;
diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h
index 53fdea3ca8e..ea2d5453af3 100644
--- a/src/widgets/itemviews/qtreewidget_p.h
+++ b/src/widgets/itemviews/qtreewidget_p.h
@@ -17,7 +17,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qabstractitemmodel.h>
#include <private/qabstractitemmodel_p.h>
-#include <QtCore/qpair.h>
#include <QtCore/qbasictimer.h>
#include <QtWidgets/qtreewidget.h>
#include <private/qtreeview_p.h>
@@ -77,10 +76,10 @@ public:
void sort(int column, Qt::SortOrder order) override;
void ensureSorted(int column, Qt::SortOrder order,
int start, int end, const QModelIndex &parent);
- static bool itemLessThan(const QPair<QTreeWidgetItem*,int> &left,
- const QPair<QTreeWidgetItem*,int> &right);
- static bool itemGreaterThan(const QPair<QTreeWidgetItem*,int> &left,
- const QPair<QTreeWidgetItem*,int> &right);
+ static bool itemLessThan(const std::pair<QTreeWidgetItem*,int> &left,
+ const std::pair<QTreeWidgetItem*,int> &right);
+ static bool itemGreaterThan(const std::pair<QTreeWidgetItem*,int> &left,
+ const std::pair<QTreeWidgetItem*,int> &right);
static QList<QTreeWidgetItem*>::iterator sortedInsertionIterator(
const QList<QTreeWidgetItem*>::iterator &begin,
const QList<QTreeWidgetItem*>::iterator &end,
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index a3a73682d64..ab9d7fd98a3 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3811,8 +3811,8 @@ void QApplicationPrivate::activateImplicitTouchGrab(QWidget *widget, QTouchEvent
bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, const QTouchEvent *te)
{
QApplicationPrivate *d = self;
- // TODO get rid of this QPair
- typedef QPair<QEventPoint::State, QList<QEventPoint> > StatesAndTouchPoints;
+ // TODO get rid of this std::pair
+ typedef std::pair<QEventPoint::State, QList<QEventPoint> > StatesAndTouchPoints;
QHash<QWidget *, StatesAndTouchPoints> widgetsNeedingEvents;
const auto *device = te->pointingDevice();