diff options
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qfutureinterface.cpp | 4 | ||||
-rw-r--r-- | src/corelib/thread/qfutureinterface.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qpromise.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qpromise.qdoc | 7 |
4 files changed, 19 insertions, 0 deletions
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index 22c8a48411..8906245191 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -351,7 +351,11 @@ void QFutureInterfaceBase::reportException(const QException &exception) } } +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) void QFutureInterfaceBase::reportException(std::exception_ptr exception) +#else +void QFutureInterfaceBase::reportException(const std::exception_ptr &exception) +#endif { QMutexLocker locker(&d->m_mutex); if (d->state.loadRelaxed() & (Canceled|Finished)) diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h index 4da5b36eae..6df15304fc 100644 --- a/src/corelib/thread/qfutureinterface.h +++ b/src/corelib/thread/qfutureinterface.h @@ -107,7 +107,11 @@ public: void reportCanceled(); #ifndef QT_NO_EXCEPTIONS void reportException(const QException &e); +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) void reportException(std::exception_ptr e); +#else + void reportException(const std::exception_ptr &e); +#endif #endif void reportResultsReady(int beginIndex, int endIndex); diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h index afe51e07d0..a1ac8eaf27 100644 --- a/src/corelib/thread/qpromise.h +++ b/src/corelib/thread/qpromise.h @@ -85,7 +85,11 @@ public: } #ifndef QT_NO_EXCEPTIONS void setException(const QException &e) { d.reportException(e); } +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) void setException(std::exception_ptr e) { d.reportException(e); } +#else + void setException(const std::exception_ptr &e) { d.reportException(e); } +#endif #endif void start() { d.reportStarted(); } void finish() { d.reportFinished(); } diff --git a/src/corelib/thread/qpromise.qdoc b/src/corelib/thread/qpromise.qdoc index f051faf9f9..16cf6e63f3 100644 --- a/src/corelib/thread/qpromise.qdoc +++ b/src/corelib/thread/qpromise.qdoc @@ -142,10 +142,17 @@ \sa isCanceled() */ +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) /*! \fn template<typename T> void QPromise<T>::setException(std::exception_ptr e) \overload */ +#else +/*! \fn template<typename T> void QPromise<T>::setException(const std::exception_ptr &e) + + \overload +*/ +#endif /*! \fn template<typename T> void QPromise<T>::start() |