Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
18 May 2023
The class QTimer is your tool if you want something to happen, say every 100 ms.
But in that case, is it exactly every 100 ms, or could the next one go off say 96ms later? By default, it actually could.
Are you guaranteed that it will go off every 100ms? The answer depends on what you are otherwise doing on your gui thread.
Better watch this episode to understand these issues in details.
0:00 Intro
0:54 The timer code
3:04 Understanding the error - the timeout happens early
4:28 Different timer types
7:04 Fixing the clock
7:44 Timers are triggered by the event loop
8:26 Example of a timer that doesn't fire while the app if busy
12:00 Debugging into Qt to understand coarse timers
Links:
Building Qt yourself: https://youtu.be/-5l2ozI_6v0?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI
All QML tips and tricks videos : https://www.youtube.com/playlist?list=PL6CJYn40gN6jWHP5krsQrVGyYtKh3A3be
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI