Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-79017

on iOS, Animation in QML decreases accuracy of Timers by 15%

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS

    Description

      I have the following Main.qml

      import QtQuick 2.0
      import QtQuick.Window 2.10
      
      Window {
          id: app
          visible: true
          width: 640
          height: 480
      
          Rectangle {
              id: btn
              anchors.fill: parent
              color: "green"
              SequentialAnimation {
                  running: true
                  loops: Animation.Infinite
                  NumberAnimation {target: btn; property: "width"; to: 60; duration: 1000}
                  NumberAnimation {target: btn; property: "width"; to: 70; duration: 1000}
              }
              Timer {
                  interval: 10000
                  running: true
                  repeat: true
                  onTriggered: console.log("*** timer  ")
              }
          }
      } 

      When running this on iOS (on a recent iPhone XR), I get the following logs (I installed my own message handler to add timestamps)

      13:50:41.250 Debug: *** timer   
      13:50:52.749 Debug: *** timer   
      13:51:04.486 Debug: *** timer   
      13:51:16.378 Debug: *** timer   

      As you can see, the 10s timer fires only after about 11.5s.

      When changing `running` to false, or `Window` to `Item`, the timer fires accurately again.  This problem is not seen on Mac, Linux or Android

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            vdaele vdaele
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes