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

OpacityAnimator shouldn't require explicit from value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.9.2
    • None

       

      Define OpacityAnimator with to property pointing to a new value. Start animation.

       

      Expected result: Like NumberAnimation the animation plays from the current value to the new value.

      Actual result: OpacityAnimator doesn't play animation unless you explicitly set something to the "OpacityAnimator.from" property. Didn't try out, but fear other Animators may face the same usability short-coming, and inconsistency with the traditional Animation elements.

       

       

      import QtQuick 2.6
      
      Rectangle {
          width: 300
          height: 300
          Rectangle {
              id: item
              color: "black"
              width: 100
              height: 100
              anchors.centerIn: parent
              NumberAnimation {
                  target: item
                  duration: 2000
                  property: "opacity"
                  to: 0.0 // Animates from implicit 1.0
                  running: false
              }
              OpacityAnimator {
                  target: item
                  duration: 2000
                  to: 0.0 // Doesn't animate from the initial opacity 1.0
                  running: true
              }
         }
      }
      

       

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

            sletta Gunnar Sletta
            jpetrell Joona Petrell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes