qt6-bb10/tests/auto/gui/kernel
Ahmad Samir bd764cc1ca Add QChronoTimer, a timer with nanoseconds precision
The interval in QTimer is a QProperty of type int, which means it's
limited to the number of milliseconds that would fit in an int (~24
days), this could cause overflow if a user constructs a QTimer with an
interval > INT_MAX milliseconds. And it can't be easily changed to use
qint64/std::chrono::nanoseconds:
  - changing the getters to return qint64 means user code would have
    narrowing conversions
  - the bindable QProperty interval can't be changed to qint64 during
    Qt6's lifetime without the risk of breaking user code
  - adding a new bindable QProperty that is qint64/nanoseconds is an
    option, but it has the complication of what to do with the int
    interval; set it when setInterval(milliseconds) is used by using
    saturation arithmetic? and what about notifying observers of the
    changed interval?

Thus the idea of creating a new stop-gap class, QChronoTimer, as a
cleaner solution. Both classes use QTimerPrivate.

During the lifetime of Qt6, QTimer's interval range is about 24 days,
whereas QChronoTimer's interval range is about 292 years
(duration_cast<years>nanoseconds::max()).

Currently the plan is to fold QChronotTimer back into QTimer in Qt7.

Mark all QPropertyS in the new class as FINAL since they aren't
intended to be overridden; this offers a performance boost for QML[1].

[1] https://lists.qt-project.org/pipermail/development/2024-February/044977.html

[ChangeLog][QtCore] Added QChronoTimer, which uses a
std::chrono::nanoseconds intervals, as a replacement for QTimer.

Fixes: QTBUG-113544
Change-Id: I71697f4a8b35452c6b5604b1322ee7f0b4453f04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-03 19:56:55 +02:00
..
noqteventloop Change license for tests files 2024-02-04 09:56:42 +01:00
qaction Change license for tests files 2024-02-04 09:56:42 +01:00
qactiongroup Change license for tests files 2024-02-04 09:56:42 +01:00
qaddpostroutine Change license for tests files 2024-02-04 09:56:42 +01:00
qbackingstore macOS: Implement support for backing store static contents 2024-02-13 13:55:01 +01:00
qclipboard Change license for tests files 2024-02-04 09:56:42 +01:00
qcursor Change license for tests files 2024-02-04 09:56:42 +01:00
qdrag Change license for tests files 2024-02-04 09:56:42 +01:00
qevent Change license for tests files 2024-02-04 09:56:42 +01:00
qfileopenevent Change license for tests files 2024-02-04 09:56:42 +01:00
qguiapplication Change license for tests files 2024-02-04 09:56:42 +01:00
qguichronotimer Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00
qguieventdispatcher QEventDispatcher: test with glib disabled too 2023-08-11 16:45:40 +03:00
qguieventloop CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
qguimetatype Change license for tests files 2024-02-04 09:56:42 +01:00
qguitimer tst_QTimer: refactor CMake code 2023-11-22 06:34:29 +02:00
qguivariant Change license for tests files 2024-02-04 09:56:42 +01:00
qhighdpi Change license for tests files 2024-02-04 09:56:42 +01:00
qinputdevice Change license for tests files 2024-02-04 09:56:42 +01:00
qinputmethod Change license for tests files 2024-02-04 09:56:42 +01:00
qkeyevent Change license for tests files 2024-02-04 09:56:42 +01:00
qkeysequence Change license for tests files 2024-02-04 09:56:42 +01:00
qmouseevent Change license for tests files 2024-02-04 09:56:42 +01:00
qmouseevent_modal Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglwindow Change license for tests files 2024-02-04 09:56:42 +01:00
qpalette Change license for tests files 2024-02-04 09:56:42 +01:00
qpixelformat Change license for tests files 2024-02-04 09:56:42 +01:00
qrasterwindow Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qscreen Change license for tests files 2024-02-04 09:56:42 +01:00
qshortcut Change license for tests files 2024-02-04 09:56:42 +01:00
qsurfaceformat Change license for tests files 2024-02-04 09:56:42 +01:00
qtouchevent Change license for tests files 2024-02-04 09:56:42 +01:00
qwindow Change license for tests files 2024-02-04 09:56:42 +01:00
CMakeLists.txt Add QChronoTimer, a timer with nanoseconds precision 2024-03-03 19:56:55 +02:00