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

StackView: pop() with StackView.Immediate leads to blank StackView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 6.3.0 Alpha
    • 5.9.0, 5.12.3
    • Quick: Controls 2
    • None
    • Arch Linux, KDE Plasma 5.10
    • 5339b3eb13f4a175372d46d91e2fc0be3c145344 (qt/qtdeclarative/dev) 73ba2d808a25182c50ad0d4f3ad63f7bbd594143 (qt/qtdeclarative/6.2)

      When calling

      pop(StackView.Immediate)
      

      this will lead to a blank stack view with no content shown anymore. Calling without the SackView.Immediate parameter works properly.

      Also, when the push transaction has been called with StackView.Immediate, all seems to work fine as well.

      Example Code (press the "push" button a few times, then "pop").

      import QtQuick 2.9
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.3
      
      ApplicationWindow {
          id: rootwindow
          visible: true
          width: 640
          height: 480
      
          title: qsTr("Hello World")
      
          property int counter: 0
      
          Component {
              id: rectcomponent
              Rectangle {
                  color: "#ff0000"
                  property alias text: label.text
      
                  Text {
                      id: label
                      anchors.centerIn: parent
                  }
              }
          }
      
          ColumnLayout {
              id: buttonrow
              anchors.fill: parent
      
              Button {
                  text: "pop"
                  onClicked: stack.pop(StackView.Immediate)
              }
      
              Button {
                  text: "push"
                  onClicked: {
                      stack.push(rectcomponent, {text: rootwindow.counter});
                      rootwindow.counter++;
                  }
              }
      
              StackView {
                  id: stack
                  Layout.fillHeight: true
                  Layout.fillWidth: true
              }
          }
      }
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            marsupial Fabian Beutel
            Votes:
            7 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: