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 QSet; template class QStack; template class QVarLengthArray; template class QList; -template using QVector = QList; #ifndef Q_CLANG_QDOC +template using QVector = QList; using QStringList = QList; using QByteArrayList = QList; #else +template 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; template <> struct QListSpecialMethods; +#ifdef Q_QDOC // define QVector for QDoc +template class QVector : public QList {}; +#endif + template 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 &other) const; + bool operator!=(const QList &other) const; +#endif + void swap(QList &other) noexcept { qSwap(d, other.d); } template 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 void QList::append(const T &value) + \fn template void QList::append(const_reference value) Inserts \a value at the end of the list. @@ -655,7 +655,7 @@ */ /*! - \fn template void QList::append(T &&value) + \fn template void QList::append(rvalue_ref value) \since 5.6 \overload @@ -687,7 +687,7 @@ /*! \fn template void QList::prepend(const T &value) - \fn template void QList::prepend(T &&value) + \fn template void QList::prepend(rvalue_ref value) Inserts \a value at the beginning of the list. @@ -727,8 +727,8 @@ \sa emplace */ -/*! \fn template void QList::insert(qsizetype i, const T &value) - \fn template void QList::insert(qsizetype i, T &&value) +/*! \fn template void QList::insert(qsizetype i, parameter_type value) + \fn template void QList::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 void QList::insert(qsizetype i, qsizetype count, const T &value) +/*! \fn template void QList::insert(qsizetype i, qsizetype count, parameter_type value) \overload @@ -757,9 +757,8 @@ \snippet code/src_corelib_tools_qlist.cpp 10 */ -/*! - \fn template QList::iterator QList::insert(iterator before, const T &value) - \fn template QList::iterator QList::insert(iterator before, T &&value) +/*! \fn template QList::iterator QList::insert(const_iterator before, parameter_type value) + \fn template QList::iterator QList::insert(const_iterator before, rvalue_ref value) \overload @@ -767,7 +766,7 @@ \a before. Returns an iterator pointing at the inserted item. */ -/*! \fn template QList::iterator QList::insert(iterator before, qsizetype count, const T &value) +/*! \fn template QList::iterator QList::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 void QList::replace(qsizetype i, const T &value) + \fn template void QList::replace(qsizetype i, rvalue_ref value) Replaces the item at index position \a i with \a value. @@ -929,7 +929,7 @@ */ /*! - \fn template template QList::iterator QList::emplace(QList::iterator before, Args&&... args) + \fn template template QList::iterator QList::emplace(const_iterator before, Args&&... args) \overload @@ -940,7 +940,7 @@ Returns an iterator to the new element. */ -/*! \fn template QList &QList::fill(const T &value, qsizetype size = -1) +/*! \fn template QList &QList::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 void QList::push_back(T &&value) +/*! \fn template void QList::push_back(rvalue_ref value) \since 5.6 \overload */ /*! \fn template void QList::push_front(const T &value) - \fn template void QList::push_front(T &&value) + \fn template void QList::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 void QList::operator+=(T &&value) +/*! \fn template void QList::operator+=(rvalue_ref value) \since 5.11 \overload @@ -1366,7 +1366,7 @@ \sa append(), operator+=() */ -/*! \fn template QList &QList::operator<<(T &&value) +/*! \fn template QList &QList::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 QList QList::toList() const \fn template QList QList::toVector() const \obsolete