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

Tumbler: setting initial currentIndex selects wrong item with wrap disabled

XMLWordPrintable

      If currentIndex is set to 1 initially and wrap is disabled, it automatically selects some other item, probably based on the initial view position:

      import QtQuick 2.10
      import QtQuick.Controls 2.3
      
      ApplicationWindow {
          id: window
          visible: true
          width: 600
          height: 440
          title: "contentY: " + view.contentY.toFixed(2)
                 + ", originY: " + view.originY.toFixed(2)
                 + ", currentIndex: " + view.currentIndex
      
          property Item view: tumbler.contentItem.children[0]
      
          Tumbler {
              id: tumbler
              model: 30
              currentIndex: 1
              anchors.fill: parent
              anchors.margins: 20
              wrap: false
              visibleItemCount: 7
          }
      }
      

        1. issue_tumbler_initial_position_2.zip
          3 kB
          Hitoshi Ito
        2. main.qml
          0.4 kB
          Joni Poikelin
        3. screenshot-1.png
          541 kB
          Nazar Gerasymchuk
        For Gerrit Dashboard: QTBUG-66801
        # Subject Branch Project Status CR V

            mhqanbari MohammadHossein Qanbari
            poikelin Joni Poikelin
            Votes:
            8 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                There is 1 open Gerrit change