summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qtimer.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-07-08 18:52:24 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-11-04 18:22:24 +0300
commit9e1210752f88dc2611de59c75b6b2776794d919a (patch)
tree3943ef65278863a75a927adc5b872f2441f64d4c /src/corelib/kernel/qtimer.cpp
parentb13c46d6ef6003c267c976942db05cdaec0a6f75 (diff)
QSingleShotTimer: port to chrono
Use std::chrono::ceil<milliseconds> to match what QDeadlineTimer::remainingTime() did. Drive-by change: make a method private instead of protected, nothing inherits from this class anyway Change-Id: I605b7c25ea7501ee92518ec9f0ff049ed810bfb4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qtimer.cpp')
-rw-r--r--src/corelib/kernel/qtimer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 19e80ca6730..90f6dacd428 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -15,6 +15,8 @@
#include "qproperty_p.h"
#include "qthread.h"
+using namespace std::chrono_literals;
+
QT_BEGIN_NAMESPACE
/*!
@@ -299,7 +301,7 @@ void QTimer::singleShotImpl(int msec, Qt::TimerType timerType,
return;
}
- new QSingleShotTimer(msec, timerType, receiver, slotObj);
+ new QSingleShotTimer(msec * 1ms, timerType, receiver, slotObj);
}
/*!
@@ -364,7 +366,7 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
Qt::QueuedConnection);
return;
}
- (void) new QSingleShotTimer(msec, timerType, receiver, member);
+ (void) new QSingleShotTimer(msec * 1ms, timerType, receiver, member);
}
}