diff options
| author | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-03-30 10:46:00 +0200 |
|---|---|---|
| committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2020-04-01 21:51:13 +0200 |
| commit | 0f78e85421de113d73edf0d58b34e12ad188417c (patch) | |
| tree | 08d12c70cb555c6514d2ad202b79389f9b50f8c4 /src/corelib/thread/qfutureinterface.h | |
| parent | 495f958b9ac5c45196e743fcba300fcfd25b90a3 (diff) | |
Add support of failure handler callbacks to QFuture
Added QFuture::onFailed() method, which allows attaching handlers for
exceptions that may occur in QFuture continuation chains.
Task-number: QTBUG-81588
Change-Id: Iadeee99e3a7573207f6ca9f650ff9f7b6faa2cf7
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/thread/qfutureinterface.h')
| -rw-r--r-- | src/corelib/thread/qfutureinterface.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index c8298d07423..04828609baa 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -63,6 +63,11 @@ class QFutureWatcherBasePrivate; namespace QtPrivate { template<typename Function, typename ResultType, typename ParentResultType> class Continuation; + +#ifndef QT_NO_EXCEPTIONS +template<class Function, class ResultType> +class FailureHandler; +#endif } class Q_CORE_EXPORT QFutureInterfaceBase @@ -158,6 +163,11 @@ private: template<typename Function, typename ResultType, typename ParentResultType> friend class QtPrivate::Continuation; +#ifndef QT_NO_EXCEPTIONS + template<class Function, class ResultType> + friend class QtPrivate::FailureHandler; +#endif + protected: void setContinuation(std::function<void()> func); void runContinuation() const; |
