summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qsharedpointer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qsharedpointer.cpp')
-rw-r--r--src/corelib/tools/qsharedpointer.cpp108
1 files changed, 104 insertions, 4 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index e19ccca0069..767b7191a17 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -595,8 +595,24 @@
\sa isNull()
*/
+/*
+//! [cast-overload-for-this]
+ The returned QSharedPointer shares ownership with the same set of
+ shared owners as \c {*this}.
+
+ This function \l {reset()}{resets} \c {*this} to \nullptr on success.
+//! [cast-overload-for-this]
+
+//! [cast-overload-for-arg]
+ The returned QSharedPointer shares ownership with the same set of
+ shared owners as \a {\1}.
+
+ This function \l {reset()}{resets} \a {\1} to \nullptr on success.
+//! [cast-overload-for-arg]
+*/
+
/*!
- \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::staticCast() const
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::staticCast() const &
Performs a static cast from this pointer's type to \tt X and returns
a QSharedPointer that shares the reference. This function can be
@@ -611,7 +627,17 @@
*/
/*!
- \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::dynamicCast() const
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::staticCast() &&
+ \since 6.9
+ \overload staticCast()
+
+ \include qsharedpointer.cpp {cast-overload-for-this}
+
+ \sa dynamicCast(), constCast(), qSharedPointerCast()
+*/
+
+/*!
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::dynamicCast() const &
Performs a dynamic cast from this pointer's type to \tt X and
returns a QSharedPointer that shares the reference. If this
@@ -628,7 +654,17 @@
*/
/*!
- \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::constCast() const
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::dynamicCast() &&
+ \since 6.9
+ \overload dynamicCast()
+
+ \include qsharedpointer.cpp {cast-overload-for-this}
+
+ \sa qSharedPointerDynamicCast()
+*/
+
+/*!
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::constCast() const &
Performs a \tt const_cast from this pointer's type to \tt X and returns
a QSharedPointer that shares the reference. This function can be
@@ -639,7 +675,17 @@
*/
/*!
- \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::objectCast() const
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::constCast() &&
+ \since 6.9
+ \overload constCast()
+
+ \include qsharedpointer.cpp {cast-overload-for-this}
+
+ \sa isNull(), qSharedPointerConstCast()
+*/
+
+/*!
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::objectCast() const &
\since 4.6
Performs a \l qobject_cast() from this pointer's type to \tt X and
@@ -657,6 +703,16 @@
*/
/*!
+ \fn template <class T> template <class X> QSharedPointer<X> QSharedPointer<T>::objectCast() &&
+ \since 6.9
+ \overload objectCast()
+
+ \include qsharedpointer.cpp {cast-overload-for-this}
+
+ \sa qSharedPointerObjectCast()
+*/
+
+/*!
\fn template <class T> template <typename... Args> QSharedPointer<T> QSharedPointer<T>::create(Args &&... args)
\overload
\since 5.1
@@ -1195,6 +1251,17 @@
*/
/*!
+ \fn template <class X, class T> QSharedPointer<X> qSharedPointerCast(QSharedPointer<T> &&other)
+ \relates QSharedPointer
+ \since 6.9
+ \overload qSharedPointerCast(const QSharedPointer<T> &other)
+
+ \include qsharedpointer.cpp {cast-overload-for-arg} {other}
+
+ \sa QSharedPointer::staticCast(), qSharedPointerDynamicCast(), qSharedPointerConstCast()
+*/
+
+/*!
\fn template <class X, class T> QSharedPointer<X> qSharedPointerCast(const QWeakPointer<T> &other)
\relates QSharedPointer
\relates QWeakPointer
@@ -1232,6 +1299,17 @@
*/
/*!
+ \fn template <class X, class T> QSharedPointer<X> qSharedPointerDynamicCast(QSharedPointer<T> &&src)
+ \relates QSharedPointer
+ \since 6.9
+ \overload qSharedPointerDynamicCast(const QSharedPointer<T> &src)
+
+ \include qsharedpointer.cpp {cast-overload-for-arg} {src}
+
+ \sa QSharedPointer::dynamicCast(), qSharedPointerCast(), qSharedPointerConstCast()
+*/
+
+/*!
\fn template <class X, class T> QSharedPointer<X> qSharedPointerDynamicCast(const QWeakPointer<T> &src)
\relates QSharedPointer
\relates QWeakPointer
@@ -1266,6 +1344,17 @@
*/
/*!
+ \fn template <class X, class T> QSharedPointer<X> qSharedPointerConstCast(QSharedPointer<T> &&src)
+ \relates QSharedPointer
+ \since 6.9
+ \overload qSharedPointerConstCast(const QSharedPointer<T> &src)
+
+ \include qsharedpointer.cpp {cast-overload-for-arg} {src}
+
+ \sa QSharedPointer::constCast(), qSharedPointerCast(), qSharedPointerDynamicCast()
+*/
+
+/*!
\fn template <class X, class T> QSharedPointer<X> qSharedPointerConstCast(const QWeakPointer<T> &src)
\relates QSharedPointer
\relates QWeakPointer
@@ -1303,6 +1392,17 @@
*/
/*!
+ \fn template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(QSharedPointer<T> &&src)
+ \relates QSharedPointer
+ \since 6.9
+ \overload qSharedPointerObjectCast(const QSharedPointer<T> &src)
+
+ \include qsharedpointer.cpp {cast-overload-for-arg} {src}
+
+ \sa QSharedPointer::objectCast(), qSharedPointerCast(), qSharedPointerConstCast()
+*/
+
+/*!
\fn template <class X, class T> std::shared_ptr<X> qSharedPointerObjectCast(const std::shared_ptr<T> &src)
\relates QSharedPointer
\since 5.14