diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-10-10 18:58:22 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-12-03 17:57:09 +0000 |
commit | 7f4d0405b409b1d3aa9d91e31972669576ec698c (patch) | |
tree | 62dbdef41552dc1873e7a15ae8e2e1d48b63d0a0 /src/corelib/tools/qlist.h | |
parent | 972f8845a85d6a07140025e4257cb8a1a2699b5d (diff) |
Rename QList<T>::swap(int, int) to swapItemsAt()
The old name was confusing as it conflicted with
QList<T>::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 <jedrzej.nowacki@qt.io>
Diffstat (limited to 'src/corelib/tools/qlist.h')
-rw-r--r-- | src/corelib/tools/qlist.h | 8 |
1 files changed, 6 insertions, 2 deletions
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<T>::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<T>::replace(int i, const T &t) } template <typename T> -inline void QList<T>::swap(int i, int j) +inline void QList<T>::swapItemsAt(int i, int j) { Q_ASSERT_X(i >= 0 && i < p.size() && j >= 0 && j < p.size(), "QList<T>::swap", "index out of range"); |