From e5ad0e76839331f0b2b2e2592168234df7548f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Thu, 15 Apr 2021 12:42:22 +0200 Subject: Doc: Mark QSet::toList, QSet::fromList, QList::toSet, QList::fromSet as obsolete They got deprecated in code already in 92f98427326. Make sure they are marked as deprecated in the documenation, too, and give examples on what to use instead. Change-Id: I003020a44cbc6187dc813796c7f93f9f9d93bf0b Reviewed-by: Edward Welbourne Reviewed-by: Paul Wicking --- src/corelib/tools/qlist.cpp | 68 ++++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 19 deletions(-) (limited to 'src/corelib/tools/qlist.cpp') diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index c0b0912249..eb5a06bb33 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -2017,7 +2017,7 @@ void **QListData::erase(void **xi) \include containers-range-constructor.qdocinc - \sa fromSet(), toVector(), QVector::toList() + \sa toVector(), QVector::toList() */ /*! \fn template QVector QList::toVector() const @@ -2030,61 +2030,91 @@ void **QListData::erase(void **xi) \include containers-range-constructor.qdocinc - \sa toSet(), fromVector(), QVector::fromList() + \sa fromVector(), QVector::fromList() */ /*! \fn template QList QList::fromSet(const QSet &set) + \obsolete Returns a QList object with the data contained in \a set. The order of the elements in the QList is undefined. - Example: - - \snippet code/src_corelib_tools_qlistdata.cpp 23 - \include containers-range-constructor.qdocinc - \sa fromVector(), toSet(), QSet::toList() + \oldcode + QSet set; + // ... + QList list = QList::fromSet(set); + \newcode + QSet set; + // ... + QList list(set.begin(), set.end()); + \endcode + + \sa QList(InputIterator, InputIterator), fromVector(), toSet(), QSet::toList() */ /*! \fn template QSet QList::toSet() const + \obsolete Returns a QSet object with the data contained in this QList. Since QSet doesn't allow duplicates, the resulting QSet might be smaller than the original list was. - Example: - - \snippet code/src_corelib_tools_qlistdata.cpp 24 - \include containers-range-constructor.qdocinc - \sa toVector(), fromSet(), QSet::fromList() + \oldcode + QStringList list; + // ... + QSet set = list.toSet(); + \newcode + QStringList list; + // ... + QSet set(list.begin(), list.end()); + \endcode + + \sa QSet::QSet(InputIterator, InputIterator), toVector(), fromSet(), QSet::fromList() */ /*! \fn template QList QList::fromStdList(const std::list &list) + \obsolete Returns a QList object with the data contained in \a list. The order of the elements in the QList is the same as in \a list. - Example: - - \snippet code/src_corelib_tools_qlistdata.cpp 25 - \include containers-range-constructor.qdocinc - \sa toStdList(), QVector::fromStdVector() + \oldcode + std::list stdlist; + // ... + QList list = QList::fromStdList(stdlist); + \newcode + std::list stdlist; + // ... + QList list(stdlist.begin(), stdlist.end()); + \endcode + + \sa QList(InputIterator, InputIterator), toStdList(), QVector::fromStdVector() */ /*! \fn template std::list QList::toStdList() const + \obsolete Returns a std::list object with the data contained in this QList. Example: - \snippet code/src_corelib_tools_qlistdata.cpp 26 - \include containers-range-constructor.qdocinc + \oldcode + QList list; + // ... + std::list stdlist = list.toStdList(); + \newcode + QList list; + // ... + std::list stdlist(list.begin(), list.end()); + \endcode + \sa fromStdList(), QVector::toStdVector() */ -- cgit v1.2.3