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

Tumbler: setting initial currentIndex selects wrong item with wrap disabled

    XMLWordPrintable

Details

    Description

      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
          }
      }
      

      Attachments

        1. issue_tumbler_initial_position_2.zip
          3 kB
        2. main.qml
          0.4 kB
        3. screenshot-1.png
          screenshot-1.png
          541 kB

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change