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

OpacityAnimator shouldn't require explicit from value

    XMLWordPrintable

Details

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

    Description

       

      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
              }
         }
      }
      

       

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-66475
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes