From 65a249715941bf6b6ecc980d3f865f367f66522d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 28 Aug 2024 15:22:20 +0200 Subject: Make from_msecs a QTimer class-static again It will need to be called from removed_api.cpp once we widen QTimer::singleShot() from ms to ns. Don't use the QAbstractEventDispatcher::Duration typedef in qtimer.h to avoid including the resp. header. Keep the typedef as the return value on the definition of from_msecs(), though, as a static assertion that they're identical. Pick-to: 6.8 Task-number: QTBUG-128426 Change-Id: Ib59895f4441e92813fe39778bb3836b039fdfbf0 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtimer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qtimer.cpp') diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 9703d810ee9..93a2ad6d07d 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -290,7 +290,8 @@ void QTimer::timerEvent(QTimerEvent *e) } } -static QAbstractEventDispatcher::Duration from_msecs(std::chrono::milliseconds ms) +QAbstractEventDispatcher::Duration // statically asserts that Duration is nanoseconds +QTimer::from_msecs(std::chrono::milliseconds ms) { using Duration = QAbstractEventDispatcher::Duration; -- cgit v1.2.3