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

Tumbler's displacement is incorrect when model has 2 items

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.7.0 RC
    • 5.6.0
    • Quick: Controls 2
    • None
    • 4dc0c0d4fa4e886650fb72161448bfb1f621b53b

    Description

      import QtQuick 2.5
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
      
          Frame {
              anchors.centerIn: parent
      
              Tumbler {
                  id: tumbler
      
                  implicitWidth: 100
                  model: [0,1]
                  currentIndex: 1
      
                  delegate: Text {
                      text: index + " (" + Tumbler.displacement.toFixed(2) + ")"
                      horizontalAlignment: Text.AlignHCenter
                      verticalAlignment: Text.AlignVCenter
                  }
              }
          }
      }
      

      This can happen if the model count changes dynamically.

      As stated in QTBUG-53061, using a visibleItemCount of 1 is a workaround.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            krnekit Nikita Krupenko
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes