Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML Timer not working for every 100ms



  • Hi,

    I am the QML timer to refresh the screen every 100 ms but timer is not repeated for 100ms. First time it is taking around 99 sec and taking getting triggered for less time. How can we run a specific code for every 100ms. I am using QT 5.12.4



  • @Mamatha said in QML Timer not working for every 100ms:

    QML timer to refresh the screen every 100 ms

    The QML Timer is synchronized with the animation thread:

    The Timer type is synchronized with the animation timer. Since the animation timer is usually set to 60fps, the resolution of Timer will be at best 16ms.

    If the Timer is running and one of its properties is changed, the elapsed time will be reset. For example, if a Timer with interval of 1000ms has its repeat property changed 500ms after starting, the elapsed time will be reset to 0, and the Timer will be triggered 1000ms later.

    If you need better resolution, you have to do it on C++ side.



  • Thanks for the reply .Do we have any other means of refreshing the QML screen other than timer



  • @Mamatha said in QML Timer not working for every 100ms:

    Do we have any other means of refreshing the QML screen other than timer

    I am not sure to understand what you want to achieve.
    Can you give more details about what you want to "refresh".

    Just as little side note: why do you use Qt 5.12.4 and not last Qt 5.12.9, which is the last bug fix release for Qt 5.12?



  • Hi KroMignon,

    We have a screen which has multiple data which will be changed continuously in the backend. We need to update the screen with the new data every 100 ms.
    For that we are using a Timer in the QML to call the method in the backend which will use the set and get methods to update the data in the QML in the interval of 100ms.

    So i would like to know if there is any other way to refresh the QML screen without using QML Timer

    We have a licensed version of 5.12.4 so we are using the same.


  • Lifetime Qt Champion

    @Mamatha Can't the backend emit signals every 100ms to let the UI know that it should update?


Log in to reply