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

Bindings in transitions not evaluated (from property in animation)

    XMLWordPrintable

Details

    Description

      In the example below I'm trying to have an animation run inside a transition. The from value should depend on a value specified in the new state. This does not work.

      import Qt 4.7
      
      Item {
          id: item;
      
          property int p: 10;
      
      
          property int strange;
          onStrangeChanged: print("strange=" + strange);
      
          states: [
              State {
                  name: "Other"
                  PropertyChanges {
                      target: item
                      p: 20;
                  }
              }
          ]
      
          Timer {
              interval: 100
              running: true;
              onTriggered: item.state = "Other"
          }
      
          transitions: [
              Transition {
                  from: ""
                  to: "Other"
                  SequentialAnimation {
                      PropertyAction { target: item; property: "p"; }
                      ScriptAction { script: print("p=" + item.p); }
      
                      // strange should animated from 20, but it animates from 10
                      NumberAnimation { target: item; property: "strange"; from: item.p; to: 0;}
                  }
              }
          ]
      
      
      }
      

      Attachments

        Issue Links

          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
              mae mae
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes