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

Replacement API is needed for completeTransition() of StackView QML Type

    XMLWordPrintable

Details

    • All

    Description

      In Qt Quick Controls 1, StackView QML Type had a method completeTransition() that 
      Immediately completes any ongoing transition.

      void completeTransition()

      https://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html#completeTransition-method

       
      In Qt Quick Controls 2, completeTransition() was removed, and there is no replacement.

      This prevents users from implementing a featur to cancel animation, in case the animation is played by a Transition in a StackView.

      For example :

          StackView {
              id: stack
              initialItem: mainView
              anchors.top: btn.bottom
              width: parent.width
              height: 500
              pushEnter: Transition {
                  id: pushEnterTrans
                  onRunningChanged: {
                      console.log(`pushEnter transition is running: ${running}`)
                  }
                  PropertyAnimation {
                      id: pushEnterAnim
                      property: "y"
                      from: (stack.mirrored ? -1 : 1) * stack.height
                      to: 0
                      duration: 2000
                      easing.type: Easing.OutCubic
                      Component.onCompleted: {
                          console.log(`pushEnter animator is running: ${running}`)
                      }
                      onRunningChanged: {
                          console.log(`pushEnter animator is running: ${running}`)
                      }
                  }
              }
          }
       
      

      pushEnterAnim.complete() does not work here because pushEnterAnim.running never become true during the animation, while pushEnterTrans.running becomes true.

      A replacement API for completeTransition() is needed for backwards compatibility.

      Attachments

        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
            hitoshiito Hitoshi Ito
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes