diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-28 18:35:43 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-31 10:25:34 +0200 |
commit | 8529d7e3ace4994cd2caf563bb437f2c5c38bcee (patch) | |
tree | 2f1d358be2fae6905fb7a751d7c691475f7f0718 /src/corelib/tools/qsharedpointer_impl.h | |
parent | 9f7fd4923e04b3a5022e1f9b60ec1823918aefac (diff) | |
download | qt4-tools-8529d7e3ace4994cd2caf563bb437f2c5c38bcee.tar.gz |
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/tools/qsharedpointer_impl.h')
-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 e4f7ba9733..a4282e1f73 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) |