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.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 8ca153f433..73a1e6c607 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -1214,6 +1214,26 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
return x;
}
+/**
+ \internal
+ Returns a QSharedPointer<QObject> if the variant contains
+ a QSharedPointer<T> where T inherits QObject. Otherwise the behaviour is undefined.
+*/
+QSharedPointer<QObject> QtSharedPointer::sharedPointerFromVariant_internal(const QVariant &variant)
+{
+ return *reinterpret_cast<const QSharedPointer<QObject>*>(variant.constData());
+}
+
+/**
+ \internal
+ Returns a QWeakPointer<QObject> if the variant contains
+ a QWeakPointer<T> where T inherits QObject. Otherwise the behaviour is undefined.
+*/
+QWeakPointer<QObject> QtSharedPointer::weakPointerFromVariant_internal(const QVariant &variant)
+{
+ return *reinterpret_cast<const QWeakPointer<QObject>*>(variant.constData());
+}
+
QT_END_NAMESPACE
#endif