summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qfuture.h
diff options
context:
space:
mode:
authorArno Rehn <a.rehn@menlosystems.com>2021-07-09 14:29:47 +0200
committerArno Rehn <a.rehn@menlosystems.com>2021-07-12 18:33:19 +0200
commit1f2d756d92b9263fd823278cf417528cdc73685c (patch)
tree5ddf471534ffb805e81b3e7af1dd1dc72337f4cb /src/corelib/thread/qfuture.h
parent82bc752497a261669dc22e028e87c043d99355a4 (diff)
Add QFutureInterfaceBase::get() to retrieve internals of QFuture
For generic interop with other parts of Qt, we need to be able to extract the type-erased internal storage of QFuture<T>. In particular, QtWebChannel needs this to transparently support QFuture<T> as a method return type. Task-number: QTBUG-92903 Change-Id: I763f054656b8810d58720262d364baf42c47eb37 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread/qfuture.h')
-rw-r--r--src/corelib/thread/qfuture.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h
index 8c04b8c437..ab08f7861c 100644
--- a/src/corelib/thread/qfuture.h
+++ b/src/corelib/thread/qfuture.h
@@ -300,6 +300,8 @@ private:
template<class U>
friend class QFuture;
+ friend class QFutureInterfaceBase;
+
template<class Function, class ResultType, class ParentResultType>
friend class QtPrivate::Continuation;
@@ -430,6 +432,12 @@ inline QFuture<void> QFutureInterface<void>::future()
return QFuture<void>(this);
}
+template<typename T>
+QFutureInterfaceBase QFutureInterfaceBase::get(const QFuture<T> &future)
+{
+ return future.d;
+}
+
Q_DECLARE_SEQUENTIAL_ITERATOR(Future)
QT_END_NAMESPACE