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

Visible jittering when two list view delegates are animating at the same time

    XMLWordPrintable

Details

    • de8daddf8823213eb8312e3a404e7a499b5e5011

    Description

      Run the code below in qml.exe

      import Qt 4.7
      
      Item {
          width: 360
          height: 600
      
          ListView {
              id: listView
              anchors.fill: parent
              model: testModel
              delegate: listItemDelegate
              focus: true
          }
      
          ListModel {
              id: testModel
              ListElement { }
              ListElement { }
              ListElement { }
          }
      
          Component {
              id: listItemDelegate
      
              Rectangle {
                  id: listItem
                  width: listView.width
                  height: 100
      
                  states: State {
                      name: "expanded"
                      PropertyChanges { target: listItem; height: 150 }
                  }
      
                  transitions: [ Transition { NumberAnimation { target: listItem; properties: "height"; duration: 1000 } } ]
      
                  gradient: Gradient {
                      GradientStop { position: 0.0; color: "#cccccc";  }
                      GradientStop { position: 1.0; color: "#000000";  }
                  }
      
                  state: listItem.ListView.isCurrentItem ? "expanded" : "";
              }
          }
      
      
      }
      

      When switching between the first and second item with up / down arrow keys, you can see the third one jittering up and down one pixel. Are the two delegates animated with separate timers or is it just a rounding error?

      As this will probably be (QML will triumph of course ) a very common thing people will want to do there should be at least good documentation on how to implement such a list where the active and previously active item expands and contracts at the same time without jittering.

      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)
            juturune Juha Turunen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes