diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qhash.cpp | 18 | ||||
-rw-r--r-- | src/corelib/tools/qiterator.qdoc | 54 | ||||
-rw-r--r-- | src/corelib/tools/qline.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qmap.cpp | 11 | ||||
-rw-r--r-- | src/corelib/tools/qscopeguard.h | 1 | ||||
-rw-r--r-- | src/corelib/tools/qscopeguard.qdoc | 2 | ||||
-rw-r--r-- | src/corelib/tools/qset.qdoc | 86 |
7 files changed, 154 insertions, 20 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 46f87f4902..ca5b7ffd55 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1483,7 +1483,7 @@ uint qHash(long double key, uint seed) noexcept /*! \fn template <class Key, class T> QList<Key> QHash<Key, T>::uniqueKeys() const \since 4.2 - \obsolete + \obsolete Use QMultiHash for storing multiple values with the same key. Returns a list containing all the keys in the map. Keys that occur multiple times in the map (because items were inserted with insertMulti(), or @@ -1529,8 +1529,8 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QList<T> QHash<Key, T>::values(const Key &key) const - \obsolete \overload + \obsolete Use QMultiHash for storing multiple values with the same key. Returns a list of all the values associated with the \a key, from the most recently inserted to the least recently inserted. @@ -2095,6 +2095,7 @@ uint qHash(long double key, uint seed) noexcept /*! \fn template <class Key, class T> QHash<Key, T>::iterator &QHash<Key, T>::iterator::operator--() + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. The prefix -- operator (\c{--i}) makes the preceding item current and returns an iterator pointing to the new current item. @@ -2107,6 +2108,7 @@ uint qHash(long double key, uint seed) noexcept /*! \fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::iterator::operator--(int) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. \overload @@ -2116,6 +2118,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::iterator::operator+(int j) const + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Returns an iterator to the item at \a j positions forward from this iterator. (If \a j is negative, the iterator goes backward.) @@ -2127,6 +2130,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::iterator QHash<Key, T>::iterator::operator-(int j) const + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Returns an iterator to the item at \a j positions backward from this iterator. (If \a j is negative, the iterator goes forward.) @@ -2137,6 +2141,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::iterator &QHash<Key, T>::iterator::operator+=(int j) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Advances the iterator by \a j items. (If \a j is negative, the iterator goes backward.) @@ -2145,6 +2150,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::iterator &QHash<Key, T>::iterator::operator-=(int j) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Makes the iterator go back by \a j items. (If \a j is negative, the iterator goes forward.) @@ -2288,6 +2294,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::const_iterator &QHash<Key, T>::const_iterator::operator--() + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. The prefix -- operator (\c{--i}) makes the preceding item current and returns an iterator pointing to the new current item. @@ -2299,6 +2306,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::const_iterator QHash<Key, T>::const_iterator::operator--(int) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. \overload @@ -2308,6 +2316,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::const_iterator QHash<Key, T>::const_iterator::operator+(int j) const + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Returns an iterator to the item at \a j positions forward from this iterator. (If \a j is negative, the iterator goes backward.) @@ -2318,6 +2327,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::const_iterator QHash<Key, T>::const_iterator::operator-(int j) const + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Returns an iterator to the item at \a j positions backward from this iterator. (If \a j is negative, the iterator goes forward.) @@ -2328,6 +2338,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::const_iterator &QHash<Key, T>::const_iterator::operator+=(int j) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Advances the iterator by \a j items. (If \a j is negative, the iterator goes backward.) @@ -2338,6 +2349,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::const_iterator &QHash<Key, T>::const_iterator::operator-=(int j) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. Makes the iterator go back by \a j items. (If \a j is negative, the iterator goes forward.) @@ -2432,6 +2444,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::key_iterator &QHash<Key, T>::key_iterator::operator--() + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. The prefix -- operator (\c{--i}) makes the preceding item current and returns an iterator pointing to the new current item. @@ -2443,6 +2456,7 @@ uint qHash(long double key, uint seed) noexcept */ /*! \fn template <class Key, class T> QHash<Key, T>::key_iterator QHash<Key, T>::key_iterator::operator--(int) + \obsolete This operator is deprecated in order to align with std::unordered_map functionality. \overload diff --git a/src/corelib/tools/qiterator.qdoc b/src/corelib/tools/qiterator.qdoc index 8cfa665ffd..9efc1bb48a 100644 --- a/src/corelib/tools/qiterator.qdoc +++ b/src/corelib/tools/qiterator.qdoc @@ -637,12 +637,22 @@ \sa hasNext(), next(), peekPrevious() */ +/*! + \fn template <class T> bool QMutableSetIterator<T>::hasPrevious() const + \obsolete Deprecated in order to align with std::unordered_set functionality. + + Returns \c true if there is at least one item behind the iterator, + i.e. the iterator is \e not at the front of the container; + otherwise returns \c false. + + \sa hasNext(), previous() +*/ + /*! \fn template <class T> bool QListIterator<T>::hasPrevious() const \fn template <class T> bool QVectorIterator<T>::hasPrevious() const \fn template <class T> bool QSetIterator<T>::hasPrevious() const \fn template <class T> bool QMutableListIterator<T>::hasPrevious() const \fn template <class T> bool QMutableVectorIterator<T>::hasPrevious() const - \fn template <class T> bool QMutableSetIterator<T>::hasPrevious() const Returns \c true if there is at least one item behind the iterator, i.e. the iterator is \e not at the front of the container; @@ -651,10 +661,22 @@ \sa hasNext(), previous() */ +/*! + \fn template <class T> const T &QMutableSetIterator<T>::previous() + \obsolete Deprecated in order to align with std::unordered_set functionality. + + Returns the previous item and moves the iterator back by one + position. + + Calling this function on an iterator located at the front of the + container leads to undefined results. + + \sa hasPrevious(), peekPrevious(), next() +*/ + /*! \fn template <class T> const T &QListIterator<T>::previous() \fn template <class T> const T &QVectorIterator<T>::previous() \fn template <class T> const T &QSetIterator<T>::previous() - \fn template <class T> const T &QMutableSetIterator<T>::previous() Returns the previous item and moves the iterator back by one position. @@ -677,10 +699,21 @@ \sa hasPrevious(), peekPrevious(), next() */ +/*! + \fn template <class T> const T &QMutableSetIterator<T>::peekPrevious() const + \obsolete Deprecated in order to align with std::unordered_set functionality. + + Returns the previous item without moving the iterator. + + Calling this function on an iterator located at the front of the + container leads to undefined results. + + \sa hasPrevious(), previous(), peekNext() +*/ + /*! \fn template <class T> const T &QListIterator<T>::peekPrevious() const \fn template <class T> const T &QVectorIterator<T>::peekPrevious() const \fn template <class T> const T &QSetIterator<T>::peekPrevious() const - \fn template <class T> const T &QMutableSetIterator<T>::peekPrevious() const Returns the previous item without moving the iterator. @@ -701,12 +734,25 @@ \sa hasPrevious(), previous(), peekNext() */ +/*! + \fn template <class T> bool QMutableSetIterator<T>::findNext(const T &value) + \obsolete Deprecated in order to align with std::unordered_set functionality. + + Searches for \a value starting from the current iterator position + forward. Returns \c true if \a value is found; otherwise returns \c false. + + After the call, if \a value was found, the iterator is positioned + just after the matching item; otherwise, the iterator is + positioned at the back of the container. + + \sa findPrevious() +*/ + /*! \fn template <class T> bool QListIterator<T>::findNext(const T &value) \fn template <class T> bool QVectorIterator<T>::findNext(const T &value) \fn template <class T> bool QSetIterator<T>::findNext(const T &value) \fn template <class T> bool QMutableListIterator<T>::findNext(const T &value) \fn template <class T> bool QMutableVectorIterator<T>::findNext(const T &value) - \fn template <class T> bool QMutableSetIterator<T>::findNext(const T &value) Searches for \a value starting from the current iterator position forward. Returns \c true if \a value is found; otherwise returns \c false. diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp index dde66ed093..3afd23d76b 100644 --- a/src/corelib/tools/qline.cpp +++ b/src/corelib/tools/qline.cpp @@ -374,7 +374,7 @@ QDataStream &operator>>(QDataStream &stream, QLine &line) */ /*! - \enum QLineF::IntersectType + \enum QLineF::IntersectionType Describes the intersection between two lines. diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 1dcbaeec94..6c9eba0c66 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -740,7 +740,7 @@ void QMapDataBase::freeData(QMapDataBase *d) /*! \fn template <class Key, class T> QList<Key> QMap<Key, T>::uniqueKeys() const \since 4.2 - \obsolete + \obsolete Use QMultiMap for storing multiple values with the same key. Returns a list containing all the keys in the map in ascending order. Keys that occur multiple times in the map (because items @@ -802,9 +802,8 @@ void QMapDataBase::freeData(QMapDataBase *d) */ /*! \fn template <class Key, class T> QList<T> QMap<Key, T>::values(const Key &key) const - \obsolete - \overload + \obsolete Use QMultiMap for maps storing multiple values with the same key. Returns a list containing all the values associated with key \a key, from the most recently inserted to the least recently @@ -1162,7 +1161,7 @@ void QMapDataBase::freeData(QMapDataBase *d) */ /*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const Key &key, const T &value) - \obsolete + \obsolete Use QMultiMap for storing multiple values with the same key. Inserts a new item with the key \a key and a value of \a value. @@ -1177,7 +1176,7 @@ void QMapDataBase::freeData(QMapDataBase *d) /*! \fn template <class Key, class T> QMap<Key, T>::iterator QMap<Key, T>::insertMulti(const_iterator pos, const Key &key, const T &value) \overload \since 5.1 - \obsolete + \obsolete Use QMultiMap for storing multiple values with the same key. Inserts a new item with the key \a key and value \a value and with hint \a pos suggesting where to do the insert. @@ -1196,7 +1195,7 @@ void QMapDataBase::freeData(QMapDataBase *d) /*! \fn template <class Key, class T> QMap<Key, T> &QMap<Key, T>::unite(const QMap<Key, T> &other) - \obsolete + \obsolete Use QMultiMap for storing multiple values with the same key. Inserts all the items in the \a other map into this map. If a key is common to both maps, the resulting map will contain the diff --git a/src/corelib/tools/qscopeguard.h b/src/corelib/tools/qscopeguard.h index 6a5bc6cc61..d288fd63fc 100644 --- a/src/corelib/tools/qscopeguard.h +++ b/src/corelib/tools/qscopeguard.h @@ -96,6 +96,7 @@ private: template <typename F> QScopeGuard(F(&)()) -> QScopeGuard<F(*)()>; #endif +//! [qScopeGuard] template <typename F> #if __has_cpp_attribute(nodiscard) Q_REQUIRED_RESULT diff --git a/src/corelib/tools/qscopeguard.qdoc b/src/corelib/tools/qscopeguard.qdoc index 572934d890..b36299d296 100644 --- a/src/corelib/tools/qscopeguard.qdoc +++ b/src/corelib/tools/qscopeguard.qdoc @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE */ /*! - \fn template <typename F> const QScopeGuard<F> qScopeGuard(F f) + \fn [qScopeGuard] template <typename F> QScopeGuard<typename std::decay<F>::type> qScopeGuard(F &&f) \inmodule QtCore \relates QScopeGuard \brief The qScopeGuard function can be used to call a function at the end diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index 33a0697e12..42dd1288ac 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -399,6 +399,7 @@ */ /*! \fn template <class T> QSet<T>::reverse_iterator QSet<T>::rbegin() + \obsolete Deprecated in order to align with std::unordered_set functionality. \since 5.6 Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to the first @@ -408,11 +409,13 @@ */ /*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::rbegin() const + \obsolete Deprecated in order to align with std::unordered_set functionality. \since 5.6 \overload */ /*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::crbegin() const + \obsolete Deprecated in order to align with std::unordered_set functionality. \since 5.6 Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to the first @@ -422,6 +425,7 @@ */ /*! \fn template <class T> QSet<T>::reverse_iterator QSet<T>::rend() + \obsolete Deprecated in order to align with std::unordered_set functionality. \since 5.6 Returns a \l{STL-style iterators}{STL-style} reverse iterator pointing to one past @@ -431,11 +435,13 @@ */ /*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::rend() const + \obsolete Deprecated in order to align with std::unordered_set functionality. \since 5.6 \overload */ /*! \fn template <class T> QSet<T>::const_reverse_iterator QSet<T>::crend() const + \obsolete Deprecated in order to align with std::unordered_set functionality. \since 5.6 Returns a const \l{STL-style iterators}{STL-style} reverse iterator pointing to one @@ -507,6 +513,7 @@ /*! \typedef QSet::reverse_iterator \since 5.6 + \obsolete Deprecated in order to align with std::unordered_set functionality. The QSet::reverse_iterator typedef provides an STL-style non-const reverse iterator for QSet. @@ -523,6 +530,7 @@ /*! \typedef QSet::const_reverse_iterator \since 5.6 + \obsolete Deprecated in order to align with std::unordered_set functionality. The QSet::const_reverse_iterator typedef provides an STL-style const reverse iterator for QSet. @@ -921,8 +929,20 @@ /*! \fn template <class T> QSet<T>::iterator &QSet<T>::iterator::operator--() + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. + + The prefix -- operator (\c{--it}) makes the preceding item + current and returns an iterator to the new current item. + + Calling this function on QSet::begin() leads to undefined + results. + + \sa operator++() +*/ + +/*! \fn template <class T> QSet<T>::const_iterator &QSet<T>::const_iterator::operator--() - \obsolete + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. The prefix -- operator (\c{--it}) makes the preceding item current and returns an iterator to the new current item. @@ -935,8 +955,17 @@ /*! \fn template <class T> QSet<T>::iterator QSet<T>::iterator::operator--(int) + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. + + \overload + + The postfix -- operator (\c{it--}) makes the preceding item + current and returns an iterator to the previously current item. +*/ + +/*! \fn template <class T> QSet<T>::const_iterator QSet<T>::const_iterator::operator--(int) - \obsolete + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. \overload @@ -946,8 +975,19 @@ /*! \fn template <class T> QSet<T>::iterator QSet<T>::iterator::operator+(int j) const + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. + + Returns an iterator to the item at \a j positions forward from + this iterator. (If \a j is negative, the iterator goes backward.) + + This operation can be slow for large \a j values. + + \sa operator-() +*/ + +/*! \fn template <class T> QSet<T>::const_iterator QSet<T>::const_iterator::operator+(int j) const - \obsolete + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. Returns an iterator to the item at \a j positions forward from this iterator. (If \a j is negative, the iterator goes backward.) @@ -959,8 +999,19 @@ /*! \fn template <class T> QSet<T>::iterator QSet<T>::iterator::operator-(int j) const + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. + + Returns an iterator to the item at \a j positions backward from + this iterator. (If \a j is negative, the iterator goes forward.) + + This operation can be slow for large \a j values. + + \sa operator+() +*/ + +/*! \fn template <class T> QSet<T>::const_iterator QSet<T>::const_iterator::operator-(int j) const - \obsolete + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. Returns an iterator to the item at \a j positions backward from this iterator. (If \a j is negative, the iterator goes forward.) @@ -972,8 +1023,20 @@ /*! \fn template <class T> QSet<T>::iterator &QSet<T>::iterator::operator+=(int j) + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. + + Advances the iterator by \a j items. (If \a j is negative, the + iterator goes backward.) + + This operation can be slow for large \a j values. + + \sa operator-=(), operator+() + +*/ + +/*! \fn template <class T> QSet<T>::const_iterator &QSet<T>::const_iterator::operator+=(int j) - \obsolete + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. Advances the iterator by \a j items. (If \a j is negative, the iterator goes backward.) @@ -985,8 +1048,19 @@ /*! \fn template <class T> QSet<T>::iterator &QSet<T>::iterator::operator-=(int j) + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. + + Makes the iterator go back by \a j items. (If \a j is negative, + the iterator goes forward.) + + This operation can be slow for large \a j values. + + \sa operator+=(), operator-() +*/ + +/*! \fn template <class T> QSet<T>::const_iterator &QSet<T>::const_iterator::operator-=(int j) - \obsolete + \obsolete This operator is deprecated in order to align with std::unordered_set functionality. Makes the iterator go back by \a j items. (If \a j is negative, the iterator goes forward.) |