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

Feature request: StackLayout::currentItem

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.6
    • Quick: Layouts
    • None

    Description

      Due to evaluation order, "itemAt(currentIndex)" is easily called too early and can therefore return null. A read-only "currentItem" property would help, and can be used in declarative bindings.

      FocusScope {
          default property alias data: stack.data
          property alias currentIndex: stack.currentIndex
          readonly property alias currentItem: stack.itemAt(currentIndex) // oops
          StackLayout {
              id: stack
              anchors.fill: parent
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              smd Jan Arve
              jpnurmi J-P Nurmi
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes