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. "Transition completed" notification
Qt 6.11 is out! See what's new in the release blog

"Transition completed" notification

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 3.5k Views 1 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.
  • B Offline
    B Offline
    bunjee
    wrote on last edited by
    #1

    Greeting Qt Quickers,

    I'm using the following code to get notified when a transition is completed:
    @property bool pTransition: false

    transitions: Transition
    {
    SequentialAnimation
    {
    AnchorAnimation { duration: 100 }

        PropertyAnimation {
            target: item; property: "pTransition"
    
            duration: 0; to: !(pTransition)
       }
    }
    

    }

    onPTransitionChanged: console.debug("Transition completed !")@
    There must be a simpler way... is there ?

    Thanks.

    B.A.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      favoritas37
      wrote on last edited by
      #2

      Could be something like this:

      @
      signal stopped();

      transitions: Transition
      {
      SequentialAnimation
      {
      AnchorAnimation { duration: 100 }
      onRunningChanged: if(!running) stopped();
      }
      }

      onStopped: console.debug("Transition completed !")
      @

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bunjee
        wrote on last edited by
        #3

        running does not seem to change between transitions.

        Could be a bug ?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bunjee
          wrote on last edited by
          #4

          It seems that I still need to use this transition hack with Qt 4.8.1. It's not very "cute".

          Am I missing something ?

          Thanks.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mario
            wrote on last edited by
            #5

            You could also use a "ScriptAction":http://qt-project.org/doc/qt-4.8/qml-scriptaction.html as the last action in a SequentialAnimation and call a signal/function to signal that the transition is done

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bunjee
              wrote on last edited by
              #6

              Thanks Mario,

              ScriptAction is much more elegant than what I was doing.

              B.A.

              1 Reply Last reply
              0

              • Login

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