summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication_platform.h
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2021-07-29 11:58:04 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-02 07:26:46 +0000
commitdb07894dae794082122baebf577d952c6978eb8b (patch)
tree26c4b2ac1632e3325c467ea180c4d146dd0eb150 /src/corelib/kernel/qcoreapplication_platform.h
parentf242f1c1c574b01407d2a1d355ee1490393449b3 (diff)
Pass QDeadlineTimer by value in runOnAndroidMainThread()
Also change the timer default value to use QDeadlineTimer::Forever. Change-Id: Ia6d0101872a5d01b04e146cd9b2f90315cb8eb2e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 50f53b90220707664947f3d1f9468c466398ec31) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication_platform.h')
-rw-r--r--src/corelib/kernel/qcoreapplication_platform.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreapplication_platform.h b/src/corelib/kernel/qcoreapplication_platform.h
index 76779b438c..b163ccb81c 100644
--- a/src/corelib/kernel/qcoreapplication_platform.h
+++ b/src/corelib/kernel/qcoreapplication_platform.h
@@ -69,14 +69,12 @@ struct Q_CORE_EXPORT QAndroidApplication
#if QT_CONFIG(future) && !defined(QT_NO_QOBJECT)
static QFuture<QVariant> runOnAndroidMainThread(const std::function<QVariant()> &runnable,
- const QDeadlineTimer
- &timeout = QDeadlineTimer(-1));
+ const QDeadlineTimer timeout = QDeadlineTimer::Forever);
template <class T>
std::enable_if_t<std::is_invocable_v<T> && std::is_same_v<std::invoke_result_t<T>, void>,
QFuture<void>> static runOnAndroidMainThread(const T &runnable,
- const QDeadlineTimer
- &timeout = QDeadlineTimer(-1))
+ const QDeadlineTimer timeout = QDeadlineTimer::Forever)
{
std::function<QVariant()> func = [runnable](){ runnable(); return QVariant(); };
return static_cast<QFuture<void>>(runOnAndroidMainThread(func, timeout));