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

PropertyAnimator in Loader drawn incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.2, 6.5.0
    • None
    • Windows

    Description

      The PropertyAnimation seems to utilize old/wrong values for from/to if they are updated while the animation is running.

      Minimal example (working case):

          Rectangle {
              id: mainRect
              anchors.centerIn: parent
      
              implicitWidth: 200
              implicitHeight: 25
      
              clip: true
              color: "gray"
      
              Rectangle {
                  id: movingRect
                  height: mainRect.height
                  width: mainRect.width / 4
                  color: "black"
      
                  PropertyAnimation {
                      target: movingRect
                      property: "x"
                      from: -movingRect.width
                      to: movingRect.width * 4
                      duration: 2000
                      running: true
                      loops: Animation.Infinite
      
                      onFromChanged: console.warn("!!! from:", from)
                      onToChanged: console.warn("!!! to:", to)
                  }
              }
      
              width: 400
          }
      

      !!! from: -100
      !!! to: 400

      Broken case:

      // ...
      //        width: 400
              Component.onCompleted: {
                  Qt.callLater(() => { mainRect.width = 400; });
              }
      // ...

      !!! from: -50
      !!! to: 200
      !!! from: -100
      !!! to: 400

      Attachments

        1. broken.gif
          broken.gif
          22 kB
        2. working.gif
          working.gif
          13 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            justynah Justyna Hudziak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes