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

StackView.Immediate transition leads to crash when used in StackView.onRemoved

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.2
    • 5.9.1
    • Quick: Controls 2
    • None
    • b94889f49170e3d8df5b348d3f179445d892f232

    Description

      "StackView.Immediate" transition leads to a crashes when used in "StackView.onRemoved" method.

       

      StackView {
          id: stackView
          anchors.fill: parent
          initialItem: Item {
          }
      
          Component.onCompleted: stackView.push(btn1, StackView.Immediate)
      }
      
      Component {
          id: btn1
      
          Button {
              width: 100
              height: 100
              text: "Test"
              onClicked: {
                  console.log("Click 1")
                  stackView.pop(StackView.Immediate)
              }
      
              StackView.onRemoved: {
                  console.log("Removed 1");
                  stackView.push(btn2, StackView.Immediate);
              }
      
              Component.onDestruction: console.log("TestButton destruction")
          }
      }
      
      Component {
          id: btn2
      
          Button {
              width: 100
              height: 100
              text: "Test 2"
              onClicked: {
                  console.log("Click 2")
                  stackView.pop(StackView.Immediate)
              }
      
              StackView.onRemoved: {
                  console.log("Removed 2");
                  stackView.push(btn1, StackView.Immediate);
              }
      
              Component.onDestruction: console.log("TestButton destruction 2")
          }
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            DanielSt Peter Staab
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes