summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2020-10-12 15:26:50 +0200
committerAndrei Golubev <andrei.golubev@qt.io>2020-10-20 19:22:12 +0200
commitbf73495a66375b63edfcde4353b7a01869b3f11f (patch)
tree9d49fc9a027d5cd251aa7ab8ec04f69f37b294b9 /src
parent8ba59441fc62c567b1e8dadce5f6e044caa67e49 (diff)
Fix QDoc warnings for QList/QVector
Task-number: QTBUG-86553 Change-Id: Iac944c78640bfcfb6ee137c0ef3dd89387700b4c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qcontainerfwd.h5
-rw-r--r--src/corelib/tools/qlist.h10
-rw-r--r--src/corelib/tools/qlist.qdoc44
3 files changed, 40 insertions, 19 deletions
diff --git a/src/corelib/tools/qcontainerfwd.h b/src/corelib/tools/qcontainerfwd.h
index 575cd1def9..a104b11965 100644
--- a/src/corelib/tools/qcontainerfwd.h
+++ b/src/corelib/tools/qcontainerfwd.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -60,11 +60,12 @@ template <class T> class QSet;
template <class T> class QStack;
template<class T, qsizetype Prealloc = 256> class QVarLengthArray;
template <class T> class QList;
-template<typename T> using QVector = QList<T>;
#ifndef Q_CLANG_QDOC
+template<typename T> using QVector = QList<T>;
using QStringList = QList<QString>;
using QByteArrayList = QList<QByteArray>;
#else
+template<typename T> class QVector;
class QStringList;
class QByteArrayList;
#endif
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index e9fb664da1..34d67c7c92 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -74,6 +74,10 @@ public:
template <> struct QListSpecialMethods<QByteArray>;
template <> struct QListSpecialMethods<QString>;
+#ifdef Q_QDOC // define QVector for QDoc
+template<typename T> class QVector : public QList<T> {};
+#endif
+
template <typename T>
class QList
#ifndef Q_QDOC
@@ -173,6 +177,12 @@ public:
// compiler-generated special member functions are fine!
+#ifdef Q_QDOC
+ // extra missing ones:
+ bool operator==(const QList<T> &other) const;
+ bool operator!=(const QList<T> &other) const;
+#endif
+
void swap(QList<T> &other) noexcept { qSwap(d, other.d); }
template <typename U>
diff --git a/src/corelib/tools/qlist.qdoc b/src/corelib/tools/qlist.qdoc
index 8ec9b22863..e947ee6677 100644
--- a/src/corelib/tools/qlist.qdoc
+++ b/src/corelib/tools/qlist.qdoc
@@ -637,7 +637,7 @@
*/
/*!
- \fn template <typename T> void QList<T>::append(const T &value)
+ \fn template <typename T> void QList<T>::append(const_reference value)
Inserts \a value at the end of the list.
@@ -655,7 +655,7 @@
*/
/*!
- \fn template <typename T> void QList<T>::append(T &&value)
+ \fn template <typename T> void QList<T>::append(rvalue_ref value)
\since 5.6
\overload
@@ -687,7 +687,7 @@
/*!
\fn template <typename T> void QList<T>::prepend(const T &value)
- \fn template <typename T> void QList<T>::prepend(T &&value)
+ \fn template <typename T> void QList<T>::prepend(rvalue_ref value)
Inserts \a value at the beginning of the list.
@@ -727,8 +727,8 @@
\sa emplace
*/
-/*! \fn template <typename T> void QList<T>::insert(qsizetype i, const T &value)
- \fn template <typename T> void QList<T>::insert(qsizetype i, T &&value)
+/*! \fn template <typename T> void QList<T>::insert(qsizetype i, parameter_type value)
+ \fn template <typename T> void QList<T>::insert(qsizetype i, rvalue_ref value)
Inserts \a value at index position \a i in the list. If \a i is
0, the value is prepended to the list. If \a i is size(), the
@@ -746,7 +746,7 @@
\sa append(), prepend(), remove()
*/
-/*! \fn template <typename T> void QList<T>::insert(qsizetype i, qsizetype count, const T &value)
+/*! \fn template <typename T> void QList<T>::insert(qsizetype i, qsizetype count, parameter_type value)
\overload
@@ -757,9 +757,8 @@
\snippet code/src_corelib_tools_qlist.cpp 10
*/
-/*!
- \fn template <typename T> QList<T>::iterator QList<T>::insert(iterator before, const T &value)
- \fn template <typename T> QList<T>::iterator QList<T>::insert(iterator before, T &&value)
+/*! \fn template <typename T> QList<T>::iterator QList<T>::insert(const_iterator before, parameter_type value)
+ \fn template <typename T> QList<T>::iterator QList<T>::insert(const_iterator before, rvalue_ref value)
\overload
@@ -767,7 +766,7 @@
\a before. Returns an iterator pointing at the inserted item.
*/
-/*! \fn template <typename T> QList<T>::iterator QList<T>::insert(iterator before, qsizetype count, const T &value)
+/*! \fn template <typename T> QList<T>::iterator QList<T>::insert(const_iterator before, qsizetype count, parameter_type value)
Inserts \a count copies of \a value in front of the item pointed to
by the iterator \a before. Returns an iterator pointing at the
@@ -795,6 +794,7 @@
/*! \fn template <typename T> void QList<T>::replace(qsizetype i, const T &value)
+ \fn template <typename T> void QList<T>::replace(qsizetype i, rvalue_ref value)
Replaces the item at index position \a i with \a value.
@@ -929,7 +929,7 @@
*/
/*!
- \fn template <typename T> template <typename ...Args> QList<T>::iterator QList<T>::emplace(QList<T>::iterator before, Args&&... args)
+ \fn template <typename T> template <typename ...Args> QList<T>::iterator QList<T>::emplace(const_iterator before, Args&&... args)
\overload
@@ -940,7 +940,7 @@
Returns an iterator to the new element.
*/
-/*! \fn template <typename T> QList<T> &QList<T>::fill(const T &value, qsizetype size = -1)
+/*! \fn template <typename T> QList<T> &QList<T>::fill(parameter_type value, qsizetype size = -1)
Assigns \a value to all items in the list. If \a size is
different from -1 (the default), the list is resized to size \a
@@ -1249,14 +1249,14 @@
to append(\a value).
*/
-/*! \fn template <typename T> void QList<T>::push_back(T &&value)
+/*! \fn template <typename T> void QList<T>::push_back(rvalue_ref value)
\since 5.6
\overload
*/
/*!
\fn template <typename T> void QList<T>::push_front(const T &value)
- \fn template <typename T> void QList<T>::push_front(T &&value)
+ \fn template <typename T> void QList<T>::push_front(rvalue_ref value)
This function is provided for STL compatibility. It is equivalent
to prepend(\a value).
@@ -1335,7 +1335,7 @@
\sa append(), operator<<()
*/
-/*! \fn template <typename T> void QList<T>::operator+=(T &&value)
+/*! \fn template <typename T> void QList<T>::operator+=(rvalue_ref value)
\since 5.11
\overload
@@ -1366,7 +1366,7 @@
\sa append(), operator+=()
*/
-/*! \fn template <typename T> QList<T> &QList<T>::operator<<(T &&value)
+/*! \fn template <typename T> QList<T> &QList<T>::operator<<(rvalue_ref value)
\since 5.11
\overload
@@ -1466,7 +1466,7 @@
/*! \typedef QList::const_reference
- Typedef for T &. Provided for STL compatibility.
+ Typedef for const T &. Provided for STL compatibility.
*/
/*! \typedef QList::difference_type
@@ -1494,6 +1494,16 @@
Typedef for T. Provided for STL compatibility.
*/
+/*! \typedef QList::parameter_type
+
+ Trait-dependent typedef for either const T & or T.
+*/
+
+/*! \typedef QList::rvalue_ref
+
+ Trait-dependent typedef for T &&.
+*/
+
/*! \fn template <typename T> QList<T> QList<T>::toList() const
\fn template <typename T> QList<T> QList<T>::toVector() const
\obsolete