From 36df66591aa24c575f5da2851a7f265d9f6f2fa8 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 25 Sep 2020 15:21:48 +0200 Subject: [PATCH] Fix some qdoc warnings from QHash and QMultiHash It's no longer possible to decrement an iterator, and the class uses qsizetype, not int for sizes. Fix incorrect function prototypes in the documentation, and remove documentation for functions/overloads that don't exist. QMultiHash doesn't have Java style iterators (not a new issue in Qt 6), so remove the references to QMultiHashIterator. Change-Id: I149b4620963f2087f3f66bb70a9c97b292a35378 Reviewed-by: Paul Wicking --- src/corelib/tools/qhash.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 7c58be0f84..b73e29594d 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -1422,7 +1422,7 @@ size_t qHash(long double key, size_t seed) noexcept */ -/*! \fn template void QHash::reserve(int size) +/*! \fn template void QHash::reserve(qsizetype size) Ensures that the QHash's internal hash table has space to store at least \a size items without having to grow the hash table. @@ -1769,10 +1769,6 @@ size_t qHash(long double key, size_t seed) noexcept \sa remove(), take(), find() */ -/*! \fn template QHash::iterator QHash::erase(iterator pos) - \overload -*/ - /*! \fn template QHash::iterator QHash::find(const Key &key) Returns an iterator pointing to the item with the \a key in the @@ -1818,8 +1814,8 @@ size_t qHash(long double key, size_t seed) noexcept */ /*! - \fn template template QHash::iterator QHash::emplace(const Key &key, Args&&... args) - \fn template template QHash::iterator QHash::emplace(Key &&key, Args&&... args) + \fn template template QHash::iterator QHash::emplace(const Key &key, Args&&... args) + \fn template template QHash::iterator QHash::emplace(Key &&key, Args&&... args) Inserts a new element into the container. This new element is constructed in-place using \a args as the arguments for its @@ -2240,8 +2236,6 @@ size_t qHash(long double key, size_t seed) noexcept item. Calling this function on QHash::end() leads to undefined results. - - \sa operator--() */ /*! \fn template QHash::const_iterator QHash::const_iterator::operator++(int) @@ -2325,7 +2319,6 @@ size_t qHash(long double key, size_t seed) noexcept Calling this function on QHash::keyEnd() leads to undefined results. - \sa operator--() */ /*! \fn template QHash::key_iterator QHash::key_iterator::operator++(int) @@ -2466,8 +2459,6 @@ size_t qHash(long double key, size_t seed) noexcept Constructs a copy of \a other (which can be a QHash or a QMultiHash). - - \sa operator=() */ /*! \fn template template QMultiHash::QMultiHash(InputIterator begin, InputIterator end) @@ -2507,8 +2498,8 @@ size_t qHash(long double key, size_t seed) noexcept */ /*! - \fn template template QMultiHash::iterator QMultiHash::emplace(const Key &key, Args&&... args) - \fn template template QMultiHash::iterator QMultiHash::emplace(Key &&key, Args&&... args) + \fn template template QMultiHash::iterator QMultiHash::emplace(const Key &key, Args&&... args) + \fn template template QMultiHash::iterator QMultiHash::emplace(Key &&key, Args&&... args) Inserts a new element into the container. This new element is constructed in-place using \a args as the arguments for its @@ -2525,8 +2516,8 @@ size_t qHash(long double key, size_t seed) noexcept */ /*! - \fn template template QMultiHash::iterator QMultiHash::emplaceReplace(const Key &key, Args&&... args) - \fn template template QMultiHash::iterator QMultiHash::emplaceReplace(Key &&key, Args&&... args) + \fn template template QMultiHash::iterator QMultiHash::emplaceReplace(const Key &key, Args&&... args) + \fn template template QMultiHash::iterator QMultiHash::emplaceReplace(Key &&key, Args&&... args) Inserts a new element into the container. This new element is constructed in-place using \a args as the arguments for its @@ -3084,7 +3075,7 @@ size_t qHash(long double key, size_t seed) noexcept while iterators are active on that container. For more information, read \l{Implicit sharing iterator problem}. - \sa QMultiHash::iterator, QMultiHashIterator + \sa QMultiHash::iterator */ /*! \fn template QMultiHash::const_iterator::const_iterator() @@ -3157,8 +3148,6 @@ size_t qHash(long double key, size_t seed) noexcept item. Calling this function on QMultiHash::end() leads to undefined results. - - \sa operator--() */ /*! \fn template QMultiHash::const_iterator QMultiHash::const_iterator::operator++(int) @@ -3241,8 +3230,6 @@ size_t qHash(long double key, size_t seed) noexcept item. Calling this function on QMultiHash::keyEnd() leads to undefined results. - - \sa operator--() */ /*! \fn template QMultiHash::key_iterator QMultiHash::key_iterator::operator++(int)