From 7f4d0405b409b1d3aa9d91e31972669576ec698c Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 10 Oct 2018 18:58:22 +0200 Subject: Rename QList::swap(int, int) to swapItemsAt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old name was confusing as it conflicted with QList::swap(QList &other), that was doing something completely different. Rename the method to swapItemsAt() which is a lot clearer. Change-Id: Iac77a1e790a7256766f83a24d2a243c880d875f4 Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qlist.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools/qlist.h') diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index 073993ee56..fe8a1407e2 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -214,7 +214,11 @@ public: T takeFirst(); T takeLast(); void move(int from, int to); - void swap(int i, int j); + void swapItemsAt(int i, int j); +#if QT_DEPRECATED_SINCE(5, 13) && QT_VERSION < QT_VERSION_CHECK(6,0,0) + QT_DEPRECATED_X("Use QList::swapItemsAt()") + void swap(int i, int j) { swapItemsAt(i, j); } +#endif int indexOf(const T &t, int from = 0) const; int lastIndexOf(const T &t, int from = -1) const; bool contains(const T &t) const; @@ -690,7 +694,7 @@ inline void QList::replace(int i, const T &t) } template -inline void QList::swap(int i, int j) +inline void QList::swapItemsAt(int i, int j) { Q_ASSERT_X(i >= 0 && i < p.size() && j >= 0 && j < p.size(), "QList::swap", "index out of range"); -- cgit v1.2.3