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

Starting a flick from a point beyond the last item causes ugly stutter

    XMLWordPrintable

Details

    • acec7123d383840d66fa63e84d0d0a0b72820496

    Description

      Scrolling to the end of a list that keeps its highlight centered, then starting a
      flicking action from a point beyond the last item make the list jump. This does
      not happen if starting a flick from a point ahead of the first item.

      import Qt 4.7
      
      Rectangle {
          id: appRect
          width: 480
          height: 600
      
          property int itemWidth: 200
      
          ListView {
              id: list
              anchors.fill: parent
      
              model: 8
              delegate: delegateItem
              orientation: "Horizontal"
      
              snapMode: "SnapToItem"
              highlightRangeMode: "StrictlyEnforceRange"  // keep highlight visible
              flickDeceleration: 5000
      
              // center the highlighted item
              preferredHighlightBegin: (appRect.width-itemWidth)/2
              preferredHighlightEnd: (appRect.width-itemWidth)/2 + itemWidth
          }
      
      
      
          Component {
              id: delegateItem
      
              Rectangle {
                  id: item
                  color: (index%2 == 0) ? "blue" : "yellow"
      
                  width: itemWidth
                  height: 350
                  y: (list.height-height) / 2     // centered vertically
      
                  Text { anchors.centerIn: parent; font.pixelSize: 100; text: index; }
      
                  states: State {
                      name: "highlighted"
                      when: item.ListView.isCurrentItem
                      PropertyChanges {target:item; z: 100; scale: 1.25}
                  }
      
                  transitions: Transition {
                      SequentialAnimation {
                          PauseAnimation { duration: 250}
                          ParallelAnimation {
                              PropertyAction { target: item; property: "z"; }  // put highlighted item in front
                              NumberAnimation { target: item; properties: "scale"; duration: 200; }
                          }
      
                      }
                  }
              }
          }
      
      
      
      }
      
      

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            mathiasm Mathias Malmqvist
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes