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

Tumbler: setting initial currentIndex selects wrong item with wrap disabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.0 Beta 1
    • Quick: Controls 2
    • None

    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. main.qml
          0.4 kB
        2. screenshot-1.png
          screenshot-1.png
          541 kB

        Issue Links

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

          Activity

            People

              hurlevent Oliver Eftevaag
              poikelin Joni Poikelin
              Votes:
              7 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change