summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-05-17 20:04:40 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-05-17 20:42:36 +0200
commit28ce318fcbccb5a117ca4e55322ee1c1dd8d05d4 (patch)
tree139f1bb656d6358e5f0f9c25bf9447028d5e96bb /src/corelib/kernel
parentedb53d761e62ab2e2d4832399a27d580af5a24c4 (diff)
Cleanup the fallout of QWeakPointer::data() deprecation
There are still users of QWeakPointer::data(), which under certain compilers will make headersclean fail. So this patch: * ports data() to a private internalData() function and calls it from all the usage points; * adds cleanup notes for Qt 6, once some of the deprecated machinery around storing unmanaged QObjects in QWeakPointers can get removed. Change-Id: Id3bcbd23374c18a2026861c08a4dcba1670673c1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qpointer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h
index 3e92289792..80faef2990 100644
--- a/src/corelib/kernel/qpointer.h
+++ b/src/corelib/kernel/qpointer.h
@@ -83,7 +83,7 @@ public:
{ wp.assign(static_cast<QObjectType*>(p)); return *this; }
inline T* data() const
- { return static_cast<T*>(wp.d == nullptr || wp.d->strongref.load() == 0 ? nullptr : wp.value); }
+ { return static_cast<T*>(wp.internalData()); }
inline T* operator->() const
{ return data(); }
inline T& operator*() const
@@ -143,7 +143,7 @@ template<typename T>
QPointer<T>
qPointerFromVariant(const QVariant &variant)
{
- return QPointer<T>(qobject_cast<T*>(QtSharedPointer::weakPointerFromVariant_internal(variant).data()));
+ return QPointer<T>(qobject_cast<T*>(QtSharedPointer::weakPointerFromVariant_internal(variant).internalData()));
}
template <class T>