Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Timer not working for every 100ms
Forum Updated to NodeBB v4.3 + New Features

QML Timer not working for every 100ms

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 964 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mamatha
    wrote on last edited by Mamatha
    #1

    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

    KroMignonK 1 Reply Last reply
    0
    • M Mamatha

      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

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @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.

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Mamatha
        wrote on last edited by Mamatha
        #3

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

        KroMignonK 1 Reply Last reply
        0
        • M Mamatha

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

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by
          #4

          @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?

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          1 Reply Last reply
          1
          • M Offline
            M Offline
            Mamatha
            wrote on last edited by Mamatha
            #5

            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.

            jsulmJ 1 Reply Last reply
            0
            • M Mamatha

              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.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

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

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved