diff options
Diffstat (limited to 'src/corelib/tools/qset.qdoc')
-rw-r--r-- | src/corelib/tools/qset.qdoc | 55 |
1 files changed, 43 insertions, 12 deletions
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index 42dd1288ac..dcd6de3d5c 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -1071,17 +1071,32 @@ */ /*! \fn template <class T> QList<T> QSet<T>::toList() const + \obsolete Returns a new QList containing the elements in the set. The order of the elements in the QList is undefined. - Example: + \include containers-range-constructor.qdocinc - \snippet code/doc_src_qset.cpp 13 + \oldcode + QSet<QString> set; + // ... + QList<QString> list = set.toList(); + \newcode + QSet<QString> set; + // ... + QList<QString> list(set.begin(), set.end()); + \endcode - \include containers-range-constructor.qdocinc + or - \sa fromList(), QList::fromSet() + \code + QSet<QString> set; + // ... + QList<QString> list = set.values(); + \endcode + + \sa QList::QList(InputIterator, InputIterator), values(), fromList(), QList::fromSet() */ /*! \fn template <class T> QList<T> QSet<T>::values() const @@ -1089,28 +1104,44 @@ Returns a new QList containing the elements in the set. The order of the elements in the QList is undefined. - This is the same as toList(). - \include containers-range-constructor.qdocinc - \sa fromList(), QList::fromSet() + \oldcode + QSet<QString> set; + // ... + QList<QString> list = set.values(); + \newcode + QSet<QString> set; + // ... + QList<QString> list(set.begin(), set.end()); + \endcode + + + \sa QList::QList(InputIterator, InputIterator) */ /*! \fn template <class T> QSet<T> QSet<T>::fromList(const QList<T> &list) + \obsolete Returns a new QSet object containing the data contained in \a list. Since QSet doesn't allow duplicates, the resulting QSet might be smaller than the \a list, because QList can contain duplicates. - Example: - - \snippet code/doc_src_qset.cpp 14 - \include containers-range-constructor.qdocinc - \sa toList(), QList::toSet() + \oldcode + QStringList list; + // ... + QSet<QString> set = QSet<QString>::fromList(list); + \newcode + QStringList list; + // ... + QSet<QString> set(list.begin(), list.end()); + \endcode + + \sa QSet(InputIterator, InputIterator), values(), QList::toSet() */ /*! |