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

Current Index / Item is changin if swipeview is populated using a loader or repater insite a asyncronous parent Loader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2, 6.4.2
    • Quick: Controls 2
    • None
    • All

    Description

      Dynamic loading data into a swipeivew loaded asyncronous is autmomatically increment the current index.

      As example the following code 

      ApplicationWindow{
      visible: true
      Loader{
              asynchronous: true
              anchors.fill: parent
              sourceComponent:  Item{
                  //Any content here that can take some time to load
                  SwipeView{
                      anchors.fill: parent
                      currentIndex: 0
                      Repeater{
                          model: 5
                          delegate: Item{
                              Label{
                                  anchors.centerIn: parent
                                  text: qsTr("Test "+index)
                              }
                          }
                      }
                      onCurrentIndexChanged: {
                          console.debug("Index was modified to ",currentIndex)
                      }
                  }
              }
          } 
      }

      At the end of the loading data the current item and index will be 4, and not 0 as explected.

      Attachments

        1. Mac - DesignerStudio - 6-4.png
          Mac - DesignerStudio - 6-4.png
          756 kB
        2. Mac - DesignerStudio - 6-4-1.png
          Mac - DesignerStudio - 6-4-1.png
          756 kB
        3. SwipeViewAndTabBarIssue.zip
          697 kB
        4. SwipeViewAndTabBarIssue-1.zip
          697 kB
        5. swipeViewLoader.qml
          0.8 kB
        6. tabBarLoader.qml
          1 kB
        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
            cmgeorge George Calugar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes