qt6-bb10/tests/auto/corelib/kernel
Ahmad Samir 4bc0834bc1 Timers: add Qt::TimerId enum class
Which will be used to represent timer IDs. Thanks to Marc for the idea
to use "a strongly typed int".

QTimer got a new id() method that returns Qt::TimerId (can't overload
timerId()). Various classes in qtbase have a member named timerId(), but
a new method is needed anyway in QTimer so id() it is (this is the
reason QChronoTimer only has id() and no timerId()). Besides
timer.timerId() has an extra "timer".

This commit fixes the inconsistency between QObject using `0` timer id
to indicate "failed to start", while QTimer::timerId() returned `-1` to
indicate "timer is inactive". QTimer::id(), being a new method and all,
now returns Qt::TimerId::Invalid, which has value `0`, so that the
values match between the two classes. Extend the unittests to ensure
QTimer::timerId()'s behavior is preserved.

[ChangeLog][Core][QObject] Added Qt::TimerId enum class, that is used to
represent timer IDs.

Change-Id: I0e8564c1461884106d8a797cc980a669035d480a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-03 19:56:55 +02:00
..
qapplicationstatic Change license for tests files 2024-02-04 09:56:42 +01:00
qchronotimer Timers: add Qt::TimerId enum class 2024-03-03 19:56:55 +02:00
qcoreapplication Change license for tests files 2024-02-04 09:56:42 +01:00
qdeadlinetimer Change license for tests files 2024-02-04 09:56:42 +01:00
qelapsedtimer Change license for tests files 2024-02-04 09:56:42 +01:00
qeventdispatcher Change license for tests files 2024-02-04 09:56:42 +01:00
qeventloop Change license for tests files 2024-02-04 09:56:42 +01:00
qjniarray JNI: support construction of QJniArray from std::initializer_list 2024-02-26 20:17:27 +01:00
qjnienvironment Change license for tests files 2024-02-04 09:56:42 +01:00
qjniobject JNI: support construction of QJniArray from std::initializer_list 2024-02-26 20:17:27 +01:00
qjnitypes Change license for tests files 2024-02-04 09:56:42 +01:00
qmath Change license for tests files 2024-02-04 09:56:42 +01:00
qmetacontainer Change license for tests files 2024-02-04 09:56:42 +01:00
qmetaenum Change license for tests files 2024-02-04 09:56:42 +01:00
qmetamethod Change license for tests files 2024-02-04 09:56:42 +01:00
qmetaobject Change license for tests files 2024-02-04 09:56:42 +01:00
qmetaobjectbuilder Change license for tests files 2024-02-04 09:56:42 +01:00
qmetaproperty Change license for tests files 2024-02-04 09:56:42 +01:00
qmetatype Change license for tests files 2024-02-04 09:56:42 +01:00
qmimedata Change license for tests files 2024-02-04 09:56:42 +01:00
qobject QObject: fix installEventFilterOrder() test flakiness 2024-02-04 18:33:37 +01:00
qpermission Change license for tests files 2024-02-04 09:56:42 +01:00
qpointer Change license for tests files 2024-02-04 09:56:42 +01:00
qproperty Change license for tests files 2024-02-04 09:56:42 +01:00
qsignalblocker Change license for tests files 2024-02-04 09:56:42 +01:00
qsignalmapper Change license for tests files 2024-02-04 09:56:42 +01:00
qsocketnotifier Change license for tests files 2024-02-04 09:56:42 +01:00
qtimer Timers: add Qt::TimerId enum class 2024-03-03 19:56:55 +02:00
qtranslator Change license for tests files 2024-02-04 09:56:42 +01:00
qvariant Change license for tests files 2024-02-04 09:56:42 +01:00
qwineventnotifier Change license for tests files 2024-02-04 09:56:42 +01:00
qwinregistrykey 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