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

Unable to bind to paused property for NumberAnimation

    XMLWordPrintable

Details

    • 62917a96222ac8d3a391b0aefe2ee8905c8da874

    Description

      when trying to bind to paused property, it complains about
      [6768] QAbstractAnimation::pause: Cannot pause a stopped animation

      NumberAnimation on index {
          from: 1; to: 12
          duration: 1000
          running: true
          paused: !root.running
          loops: Animation.Infinite
      }
      

      the work around is to something funny like:

      NumberAnimation on index {
          id: numAniBind2
          from: 1; to: 12
          duration: 1000
          running: true
          loops: Animation.Infinite
      }
      
      Component {
          id: bindingCom
          Binding {
              target: numAniBind2
              property: "paused"
              value: numAniBind2.running ? !root.running : false
          }
      }
      
      Component.onCompleted: bindingCom.createObject(text5)
      

      In the attached test code, I tried to use 4 different ways to bind to it and only the last one is working

      Attachments

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

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            sham Anthony Sham
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes