qt5base-lts/tests/auto/corelib/kernel
Laszlo Papp 8b56b8ed32 Add a remainingTime() method to the public interface of the QTimer class
It is an extension coming from the use case when you, for instance, need to
implement a countdown timer in client codes, and manually maintain a dedicated
variable for counting down with the help of yet another Timer. There might be
other use cases as well. The returned value is meant to be in milliseconds, as
the method documentation says, since it is reasonable, and consistent with the
rest (ie. the interval accessor).

The elapsed time is already being tracked inside the event dispatcher, thus the
effort is only exposing that for all platforms supported according to the
desired timer identifier, and propagating up to the QTimer public API. It is
done by using the QTimerInfoList class in the glib and unix dispatchers, and the
WinTimeInfo struct for the windows dispatcher.

It might be a good idea to to establish a QWinTimerInfo
(qtimerinfo_win{_p.h,cpp}) in the future for resembling the interface for
windows with the glib/unix management so that it would be consistent. That would
mean abstracting out a base class (~interface) for the timer info classes.
Something like that QAbstractTimerInfo.

Test: Build test only on (Arch)Linux, Windows and Mac. I have also run the unit
tests and they passed as well.

Change-Id: Ie37b3aff909313ebc92e511e27d029abb070f110
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-04-03 15:10:05 +02:00
..
qcoreapplication Add a remainingTime() method to the public interface of the QTimer class 2012-04-03 15:10:05 +02:00
qeventdispatcher Test posted events in tst_QEventDispatcher with various flags 2012-02-10 15:22:11 +01:00
qeventloop QEvent (and subclasses): make ctors explicit 2012-03-01 08:44:34 +01:00
qmath Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qmetamethod QMetaMethod::typeName() should return "void" if the return type is void 2012-03-21 18:55:51 +01:00
qmetaobject Fix QMetaObject::normalizedType() for "void" argument 2012-03-21 18:55:27 +01:00
qmetaobjectbuilder Remove all calls to, and deprecate qMalloc, qRealloc and qFree. 2012-03-31 16:46:40 +02:00
qmetaproperty Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qmetatype Fallback implementation of Q_ALIGNOF 2012-03-23 19:43:00 +01:00
qmimedata QMimeData: export URLs as text too 2012-02-17 05:26:47 +01:00
qobject Merge master into api_changes 2012-03-23 14:10:58 +01:00
qpointer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qsignalmapper Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qsocketnotifier Fix tst_QSocketNotifier on Mac OS X 2012-02-13 22:16:17 +01:00
qtimer Add a remainingTime() method to the public interface of the QTimer class 2012-04-03 15:10:05 +02:00
qtranslator Make QTranslator testcase independent of Widgets 2012-03-28 00:44:16 +02:00
qvariant Reserve more space for built-in types in id space. 2012-03-22 11:52:23 +01:00
qwineventnotifier Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
kernel.pro Add autotest for QMetaMethod introspection 2012-02-15 17:27:04 +01:00