diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-06-20 17:40:45 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-06-29 21:58:36 +0200 |
commit | ff2b2032a089d74975da4a3fac7c7c90989e6dc5 (patch) | |
tree | 2c2930d5e38fb3f94a936e5a0c8bc2c4e5259dbb /src/corelib/doc | |
parent | fabf9239e0e6231f09d4a324bfe85ffcc529da3d (diff) |
Remove usages of deprecated APIs from QtAlgorithms
Task-number: QTBUG-76491
Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'src/corelib/doc')
4 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/doc/snippets/code/doc_src_qset.cpp b/src/corelib/doc/snippets/code/doc_src_qset.cpp index 7f7cec8b45..4248c49642 100644 --- a/src/corelib/doc/snippets/code/doc_src_qset.cpp +++ b/src/corelib/doc/snippets/code/doc_src_qset.cpp @@ -131,7 +131,7 @@ while (i != set.end()) { //! [10] QSet<QString> set; ... -QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette"); +QSet<QString>::iterator it = std::find(set.begin(), set.end(), "Jeanette"); if (it != set.end()) cout << "Found Jeanette" << Qt::endl; //! [10] @@ -150,7 +150,7 @@ for (i = set.begin(); i != set.end(); ++i) //! [12] QSet<QString> set; ... -QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette"); +QSet<QString>::iterator it = std::find(set.begin(), set.end(), "Jeanette"); if (it != set.constEnd()) cout << "Found Jeanette" << Qt::endl; //! [12] @@ -161,7 +161,7 @@ QSet<QString> set; set << "red" << "green" << "blue" << ... << "black"; QList<QString> list = set.toList(); -qSort(list); +std::sort(list.begin(), list.end()); //! [13] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp index e0d3c71dc5..e8754a5f34 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp @@ -119,8 +119,8 @@ for (i = list.begin(); i != list.end(); ++i) //! [8] QLinkedList<QString> list; ... -QLinkedList<QString>::iterator it = qFind(list.begin(), - list.end(), "Joel"); +QLinkedList<QString>::iterator it = std::find(list.begin(), + list.end(), "Joel"); if (it != list.end()) cout << "Found Joel" << Qt::endl; //! [8] @@ -189,8 +189,8 @@ for (i = list.constBegin(); i != list.constEnd(); ++i) //! [15] QLinkedList<QString> list; ... -QLinkedList<QString>::iterator it = qFind(list.constBegin(), - list.constEnd(), "Joel"); +QLinkedList<QString>::const_iterator it = std::find(list.constBegin(), + list.constEnd(), "Joel"); if (it != list.constEnd()) cout << "Found Joel" << Qt::endl; //! [15] diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp index a24e599f2f..38fa526ef4 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp @@ -247,7 +247,7 @@ QSet<int> set; set << 20 << 30 << 40 << ... << 70; QList<int> list = QList<int>::fromSet(set); -qSort(list); +std::sort(list.begin(), list.end()); //! [23] diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc index e6c95129db..919533f651 100644 --- a/src/corelib/doc/src/containers.qdoc +++ b/src/corelib/doc/src/containers.qdoc @@ -666,7 +666,7 @@ \li \b{Logarithmic time:} O(log \e n). A function that runs in logarithmic time is a function whose running time is proportional to the logarithm of the number of items in the - container. One example is qBinaryFind(). + container. One example is the binary search algorithm. \li \b{Linear time:} O(\e n). A function that runs in linear time will execute in a time directly proportional to the number of |