diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-28 16:35:43 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-31 08:25:34 (GMT) |
commit | 8529d7e3ace4994cd2caf563bb437f2c5c38bcee (patch) | |
tree | 2f1d358be2fae6905fb7a751d7c691475f7f0718 /src/corelib | |
parent | 9f7fd4923e04b3a5022e1f9b60ec1823918aefac (diff) | |
download | Qt-8529d7e3ace4994cd2caf563bb437f2c5c38bcee.zip Qt-8529d7e3ace4994cd2caf563bb437f2c5c38bcee.tar.gz Qt-8529d7e3ace4994cd2caf563bb437f2c5c38bcee.tar.bz2 |
Add an opt-in QWeakPointer::operator->.
To use this, you must add #define QWEAKPOINTER_ENABLE_ARROW to your .cpp
before #including any headers. Be careful about adding this to .h files.
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index e4f7ba9..a4282e1 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -626,6 +626,10 @@ public: inline QSharedPointer<T> toStrongRef() const { return QSharedPointer<T>(*this); } +#if defined(QWEAKPOINTER_ENABLE_ARROW) + inline T *operator->() const { return data(); } +#endif + private: #if defined(Q_NO_TEMPLATE_FRIENDS) |