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

Tumbler is unable to rapidly snap to a new position

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.8, 6.8.2, 6.9.0 Beta2
    • Quick: Controls 2
    • Windows 10 22H2, MSVC 2022 x64

    Description

      Code

      import QtQuick
      import QtQuick.Controls.Basic
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
      
          property int lastIndex: 4
      
          Row {
              anchors.fill: parent
              spacing: 10
              Column {
                  Text { text: "ListView" }
                  ListView {
                      id: listView
                      width: 100
                      height: 200
                      model: root.lastIndex + 1
                      currentIndex: root.lastIndex
                      clip: true
                      delegate: Label {
                          required property int index
                          width: ListView.view.width
                          height: ListView.view.height
                          text: index
                          verticalAlignment: Qt.AlignVCenter
                      }
                  }
                  Button {
                      text: "Decrement"
                      onClicked: listView.currentIndex--
                  }
                  Button {
                      text: "Slow Reset"
                      onClicked: listView.currentIndex = root.lastIndex
                  }
                  Button {
                      text: "Fast Reset 1"
                      onClicked: {
                          listView.currentIndex = root.lastIndex
                          listView.positionViewAtIndex(root.lastIndex, ListView.Beginning)
                      }
                  }
                  Button {
                      text: "Fast Reset 2"
                      onClicked: {
                          listView.positionViewAtIndex(root.lastIndex, ListView.Beginning)
                          listView.currentIndex = root.lastIndex
                      }
                  }
              }
              Column {
                  Text { text: "Tumbler" }
                  Tumbler {
                      id: tumbler
                      model: root.lastIndex + 1
                      currentIndex: root.lastIndex
                      wrap: false
                      visibleItemCount: 1
                  }
                  Button {
                      text: "Decrement"
                      onClicked: tumbler.currentIndex--
                  }
                  Button {
                      text: "Slow Reset"
                      onClicked: tumbler.currentIndex = root.lastIndex
                  }
                  Button {
                      text: "Fast Reset 1"
                      onClicked: {
                          tumbler.currentIndex = root.lastIndex
                          tumbler.positionViewAtIndex(root.lastIndex, Tumbler.Beginning)
                      }
                  }
                  Button {
                      text: "Fast Reset 2"
                      onClicked: {
                          tumbler.positionViewAtIndex(root.lastIndex, Tumbler.Beginning)
                          tumbler.currentIndex = root.lastIndex
                      }
                  }
              }
          }
      }
      
      

       

      Steps to reproduce

      1. Build and run the code above
      2. Follow the steps at QTBUG-134118 for the "ListView" column
      3. Follow the steps at QTBUG-134118 for the "Tumbler" column

       

      Outcomes

      • For ListView, "Fast Reset 1" quickly snaps to "4" (Expected)
      • For Tumbler, "Fast Reset 1" slowly animates to "4" (Not Expected)
      • For both ListView and Tumbler, "Fast Reset 2" suffer from the glitches described at QTBUG-134118

       

      Request
      Please make "Fast Reset 1" for Tumbler behave like ListView

      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
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes