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

Dynamically adding items to SwipeView may add new items behind the current item

XMLWordPrintable

    • 2cf897f2a (dev), 8862c989c (6.6), 42dcda6be (6.5), 1f09a9662 (tqtc/lts-6.2)

      Third item and any new items after that are added fully visible behind the first item. To reproduce, run attached example, click the button.

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Window
      import QtQuick.Layouts
      
      Window {
          visible: true
          width: 800
          height: 600
          Component {
              id: cmp
              Rectangle {
                  property int i: SwipeView.index
                  Text {
                      y: 30
                      text: "index: " + parent.i
      
                  }
                  color:"blue"
              }
          }
          Component {
              id: cmp2
              Rectangle {
                  color: "yellow"
                  property int i: SwipeView.index
                  Text {
                      text: parent.i
                  }
                  opacity: 0.3
      
                  Button {
                      anchors.centerIn: parent
                      text: "click me"
                      onClicked: {
      
                          cmp.createObject(sv)
                      }
                  }
              }
          }
      
      
          SwipeView {
              id: sv
              anchors.fill: parent
      
          }
      
          Component.onCompleted: Qt.callLater(function(){
              cmp2.createObject(sv)
              cmp.createObject(sv)
          })
      }
      

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

            mitch_curtis Mitch Curtis
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: