diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-06-25 15:22:53 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-07-02 11:48:19 (GMT) |
commit | a32019f4c2f56a84172bde739d7ea174be0db381 (patch) | |
tree | 579a815d43164fbd4003c0fb4c38aaf366d07c9c /src/corelib/tools/qsharedpointer.h | |
parent | 0b757d0c1b6f64d17086621ec692369d37fd62fc (diff) | |
download | Qt-a32019f4c2f56a84172bde739d7ea174be0db381.zip Qt-a32019f4c2f56a84172bde739d7ea174be0db381.tar.gz Qt-a32019f4c2f56a84172bde739d7ea174be0db381.tar.bz2 |
Add qobject_cast for QSharedPointer.
This obviously only works for classes that derive from QObject. And
you must remember that QSharedPointer controls the QObject's lifetime,
not the QObject parent-child relationship.
Reviewed-by: dt
Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/corelib/tools/qsharedpointer.h')
-rw-r--r-- | src/corelib/tools/qsharedpointer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h index cd6bc62..abd83ad 100644 --- a/src/corelib/tools/qsharedpointer.h +++ b/src/corelib/tools/qsharedpointer.h @@ -93,6 +93,7 @@ public: template <class X> QSharedPointer<X> staticCast() const; template <class X> QSharedPointer<X> dynamicCast() const; template <class X> QSharedPointer<X> constCast() const; + template <class X> QSharedPointer<X> objectCast() const; }; template <class T> @@ -136,6 +137,8 @@ template <class X, class T> QSharedPointer<X> qSharedPointerDynamicCast(const QS template <class X, class T> QSharedPointer<X> qSharedPointerDynamicCast(const QWeakPointer<T> &src); template <class X, class T> QSharedPointer<X> qSharedPointerConstCast(const QSharedPointer<T> &src); template <class X, class T> QSharedPointer<X> qSharedPointerConstCast(const QWeakPointer<T> &src); +template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(const QSharedPointer<T> &src); +template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(const QWeakPointer<T> &src); template <class X, class T> QWeakPointer<X> qWeakPointerCast(const QWeakPointer<T> &src); |