[Customdrawn] LazClock exercise

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Mon Apr 2 15:03:16 CEST 2012


On Mon, Apr 2, 2012 at 10:22 AM, Michael Schnell <mschnell at lumino.de> wrote:
> Of course you are right, but AFAIK, there is no documentation regarding
> TTimer on that behalf.

Yes, but it is like that on purpose. It is not documented because no
particular behavior is guaranteed and it might be different in each
widgetset or even in various versions of the same widgetset, so no
assumptions can be made. The exact behavior is considered therefore an
implementation detail and people should avoid depending on
implementation details.

The only way to make it guaranteed would be to make it run the even on
another thread and make the timer completely threaded, just like the
timer from Java is. Android adds another timer system which runs in
the main thread and just like TTimer it has no guarantees whatsoever
of any particular precision.

If Qt achieved a main thread timer with precision then I am really
impressed, although I wonder if it really works the same in all of
their platforms. In particular I doubt it works the same in Android
because Android does not allow any kind of control over the main
thread.

-- 
Felipe Monteiro de Carvalho




More information about the Customdrawn mailing list