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

StackView pop() doesn't work properly when passed an item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.3.0
    • Quick: Controls 1
    • None

      Using either the shorthand or full notation for passing an item to StackView's pop() function doesn't work properly:

      import QtQuick 2.2
      import QtQuick.Controls 1.1
      
      Rectangle {
          property Component mainMenuView: Button {
              text: "mainMenuView"
              onClicked: {
                  Stack.view.push(moviesListView)
              }
          }
      
          property Component moviesListView: Button {
              text: "moviesListView"
              onClicked: {
                  Stack.view.push(movieDetailView)
              }
          }
      
          property Component movieDetailView: Button {
              text: "movieDetailView"
              onClicked: {
                  Stack.view.push(personListView)
              }
          }
      
          property Component personListView: Button {
              text: "personListView"
              onClicked: {
                  // Wrong: goes to movieDetailView.
                  Stack.view.pop(moviesListView)
                  // Wrong: goes to mainMenuView.
      //            Stack.view.pop({item: moviesListView})
              }
          }
      
          StackView {
              initialItem: mainMenuView
          }
      }
      

      This was found by: http://stackoverflow.com/questions/23105027/pop-to-specific-item-in-qtquick-stackview

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

            richard Richard Moe Gustavsen
            mitch_curtis Mitch Curtis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes