From 1f2d756d92b9263fd823278cf417528cdc73685c Mon Sep 17 00:00:00 2001 From: Arno Rehn Date: Fri, 9 Jul 2021 14:29:47 +0200 Subject: 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. In particular, QtWebChannel needs this to transparently support QFuture as a method return type. Task-number: QTBUG-92903 Change-Id: I763f054656b8810d58720262d364baf42c47eb37 Reviewed-by: Konstantin Ritt Reviewed-by: Sona Kurazyan --- src/corelib/thread/qfuture.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/corelib/thread/qfuture.h') 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 friend class QFuture; + friend class QFutureInterfaceBase; + template friend class QtPrivate::Continuation; @@ -430,6 +432,12 @@ inline QFuture QFutureInterface::future() return QFuture(this); } +template +QFutureInterfaceBase QFutureInterfaceBase::get(const QFuture &future) +{ + return future.d; +} + Q_DECLARE_SEQUENTIAL_ITERATOR(Future) QT_END_NAMESPACE -- cgit v1.2.3