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

StackView: pushing an item again before its exiting animation ends visually clears the stack

    XMLWordPrintable

Details

    • 06162b3712b6ff2e25e1b20a139fe5c42e95b123

    Description

      If an item is pushed on the stack before its exit animation ends, the stack will display an empty content.

      Test Case

      • StackView's initial item is redRect
      • push blueRect
      • before animation ends, push redRect

      Expected result

      • redRect is visible at the end of the transitions (preferably, both rects are visible during the transitions, if possible)

      Actual result

      • StackView appears empty
      
      import QtQuick 2.10
      import QtQuick.Window 2.3
      import QtQuick.Controls 2.3
      
      ApplicationWindow {
          id: mainWindow
          visible: true
      
          StackView
          {
              id: stackView
              anchors.fill: parent
              replaceEnter: Transition {
                  XAnimator { from: stackView.width; to: 0; duration: 1000; easing.type: Easing.OutCubic }
              }
              replaceExit: Transition {
                  XAnimator { from: 0; to: -stackView.width; duration: 1000; easing.type: Easing.OutCubic }
              }
              initialItem: redRect
          }
      
          Row
          {
              spacing: 10
              anchors.centerIn: parent
              Button
              {
                  text: "red"
                  onClicked:  stackView.replace(redRect)
              }
              Button
              {
                  text: "blue"
                  onClicked: stackView.replace(blueRect)
              }
          }
      
          Rectangle { id: blueRect; color: "blue"}
          Rectangle { id: redRect; color: "red" }
      }
      
      

      Attachments

        1. stackview-complete.gif
          stackview-complete.gif
          229 kB
        2. tst_main.qml
          3 kB
        3. out-4.ogv
          23 kB

        Issue Links

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

          Activity

            People

              mitch_curtis Mitch Curtis
              yoann Yoann Quenach de Quivillic
              Votes:
              8 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes