Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. OnStopped event is not fired in SequentialAnimation
Forum Updated to NodeBB v4.3 + New Features

OnStopped event is not fired in SequentialAnimation

Scheduled Pinned Locked Moved Solved QML and Qt Quick
6 Posts 2 Posters 1.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on 6 Dec 2017, 08:31 last edited by
    #1

    Please, look at this code:

    SequentialAnimation {
            id: animStep
            PropertyAction { target: rotSpin; property: "origin.x"; value: xCenterNeedle }
            PropertyAction { target: rotSpin; property: "origin.y"; value: yCenterNeedle }
            NumberAnimation {
                id: numStep; target: rotSpin; property: "angle"; easing.type: Easing.Linear; to: _degree; duration: _time;
                onStopped: { console.log("NumberAnimation has ended"); }
            }
            PauseAnimation { duration: 1000 }
    
           onStopped:  { console.log("SequentialAnimation has ended"); }
    

    When I run this animation I get the "SequentialAnimation has ended" message only. Instead I need to know when an Animation inside the sequence has ended.

    How to achieve this?

    S 1 Reply Last reply 6 Dec 2017, 08:46
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 6 Dec 2017, 08:45 last edited by
      #2

      Maybe try with slot onRunningChanged? http://doc.qt.io/qt-5/qml-qtquick-animation.html#running-prop

      (Z(:^

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mark81
        wrote on 6 Dec 2017, 08:45 last edited by
        #3

        I found a workaround adding a ScriptAction after the Animation I'm interested to.

        1 Reply Last reply
        1
        • M Mark81
          6 Dec 2017, 08:31

          Please, look at this code:

          SequentialAnimation {
                  id: animStep
                  PropertyAction { target: rotSpin; property: "origin.x"; value: xCenterNeedle }
                  PropertyAction { target: rotSpin; property: "origin.y"; value: yCenterNeedle }
                  NumberAnimation {
                      id: numStep; target: rotSpin; property: "angle"; easing.type: Easing.Linear; to: _degree; duration: _time;
                      onStopped: { console.log("NumberAnimation has ended"); }
                  }
                  PauseAnimation { duration: 1000 }
          
                 onStopped:  { console.log("SequentialAnimation has ended"); }
          

          When I run this animation I get the "SequentialAnimation has ended" message only. Instead I need to know when an Animation inside the sequence has ended.

          How to achieve this?

          S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 6 Dec 2017, 08:46 last edited by
          #4

          @Mark81 said in OnStopped event is not fired in SequentialAnimation:

          Instead I need to know when an Animation inside the sequence has ended.

          The documentation of stopped() signal says that it won't work:

          It is only triggered for top-level, standalone animations. It will not be triggered for animations in a Behavior or Transition, or animations that are part of an animation group.

          (Z(:^

          1 Reply Last reply
          2
          • M Offline
            M Offline
            Mark81
            wrote on 6 Dec 2017, 08:50 last edited by
            #5

            Thanks, I forgot that sentence.
            It's a pity. Calling the slots also for internal Animations would lead to a very high potential to sync events.

            1 Reply Last reply
            1
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 6 Dec 2017, 08:57 last edited by
              #6

              Yep, you're right.

              (Z(:^

              1 Reply Last reply
              0

              1/6

              6 Dec 2017, 08:31

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved