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

AnimatedSprite.running defaults to true, but if it is initially invisible it won't be running

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11
    • None

    Description

      You can see this with qtdeclarative/tests/manual/pointer, if content/TouchpointFeedbackSprite.qml is modified like this:

      import QtQuick 2.8
      import Qt.labs.handlers 1.0
      
      PointHandler {
          id: handler
          objectName: "point " + handler.point.id.toString(16)
          acceptedDevices: PointerDevice.TouchScreen | PointerDevice.TouchPad
          target: AnimatedSprite {
              objectName: "sprite " + handler.point.id.toString(16)
              source: "../resources/fingersprite.png"
              visible: handler.active
      //        running: visible // workaround: running defaults to true, but we don't see it animating otherwise
      Component.onCompleted: console.log("Running " + running)
      onRunningChanged: console.log("Running " + running)
              x: handler.point.position.x - 20
              y: handler.point.position.y - 13
              width: frameWidth
              height: frameHeight
              frameWidth: 43
              frameHeight: 64
              frameCount: 3
              frameRate: 5
              parent: handler.parent
              Text {
                  text: handler.point.id.toString(16)
                  style: Text.Outline; styleColor: "white"
                  font.pixelSize: 12
                  anchors.bottom: parent.bottom
                  anchors.horizontalCenter: parent.horizontalCenter
                  anchors.horizontalCenterOffset: 4
              }
          }
      }
      

      The sprite is initially invisible, but running stays true, so we would like it to actually start running when a finger is pressed on the touchscreen. I suppose it's a performance optimization to not handle a timer event when the sprite is invisible; but either it should automatically toggle its own running state depending on whether it's visible, or maybe the state should not change, but it still needs to actually start running when it becomes visible.

      Attachments

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              srutledg Shawn Rutledge
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes