diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:04 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-05-16 18:16:04 +0300 |
commit | 231d3670981a33ec42b91ad1cb33c1fc50551066 (patch) | |
tree | b1ef1096f4e279baaa2ea0d2daf14b5c4185a82f /src/corelib/tools/qlist.cpp | |
parent | ffdd372c7bbda62e9d937f406319f38e3e982774 (diff) | |
parent | 8fc1a885d19a2dfb1a3a684aea1cfa41967e041f (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.5' into tqtc/lts-5.15-opensourcev5.15.5-lts-lgpl
Change-Id: I0cdb390124e783dc9cd832a9954baa76a0e9eb6b
Diffstat (limited to 'src/corelib/tools/qlist.cpp')
-rw-r--r-- | src/corelib/tools/qlist.cpp | 68 |
1 files changed, 49 insertions, 19 deletions
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 5d5da20752..f0b92b5206 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 <class T> QVector<T> QList<T>::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 <class T> QList<T> QList<T>::fromSet(const QSet<T> &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<int> set; + // ... + QList<int> list = QList<int>::fromSet(set); + \newcode + QSet<int> set; + // ... + QList<int> list(set.begin(), set.end()); + \endcode + + \sa QList(InputIterator, InputIterator), fromVector(), toSet(), QSet::toList() */ /*! \fn template <class T> QSet<T> QList<T>::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<QString> set = list.toSet(); + \newcode + QStringList list; + // ... + QSet<QString> set(list.begin(), list.end()); + \endcode + + \sa QSet::QSet(InputIterator, InputIterator), toVector(), fromSet(), QSet::fromList() */ /*! \fn template <class T> QList<T> QList<T>::fromStdList(const std::list<T> &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<double> stdlist; + // ... + QList<double> list = QList<double>::fromStdList(stdlist); + \newcode + std::list<double> stdlist; + // ... + QList<double> list(stdlist.begin(), stdlist.end()); + \endcode + + \sa QList(InputIterator, InputIterator), toStdList(), QVector::fromStdVector() */ /*! \fn template <class T> std::list<T> QList<T>::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<double> list; + // ... + std::list<double> stdlist = list.toStdList(); + \newcode + QList<double> list; + // ... + std::list<double> stdlist(list.begin(), list.end()); + \endcode + \sa fromStdList(), QVector::toStdVector() */ |