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

SwipeView crashes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.2.6
    • 5.9.2, 5.9.3, 5.9.4, 5.10, 5.11.1
    • Quick: Controls 2
    • None
    • Happened under Windows (7). Using both MVC and MinGW 32bit compiler.

    Description

      When using swipeview in combination with a repeater of which the model changes: the application crashes. Small example: when nbOfPages changes by clicking the button, it crashes:

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      ApplicationWindow {
          width: 640
          height: 480
          title: qsTr("Tabs")
          visible: true
      
          SwipeView {
              anchors.fill: parent
              id: swipeView
              property int nbOfPages: 4
              onNbOfPagesChanged: console.log("onNbOfPagesChanged (now:", nbOfPages, ")")
              onCurrentIndexChanged: console.log("onCurrentIndexChanged (now:", currentIndex, ")")
              currentIndex: tabBar.currentIndex
              
              Repeater {
                  model: swipeView.nbOfPages
                  onModelChanged: console.log("onModelChanged")
      
                  Loader {
                      sourceComponent: Button {
                          text: "Increment model count"
                          onClicked: ++swipeView.nbOfPages
                      }
                  }
              }
          }
      
          header: TabBar {
              id: tabBar
              currentIndex: swipeView.currentIndex
          }
      }
      

      See also attached demo.

      The problem does not occur when using the repeater in e.g. a Column or a StackLayout.

      The problem does not arise with qt 5.9.1.

      Problem was noticed when upgrading to qt 5.10.0 and then also seen with Qt 5.9.2, Qt 5.9.3 and 5.9.4.

      The issue is still present using qt 5.11.1

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              slr Sven Leyre
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes