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

Items moving out of view are not correctly hidden during view transitions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.0.0, 5.4.0 Beta
    • Quick: Other
    • None

    Description

      Run the following code.

      Once 6 new items are added and the "original 1" item moves out of the ListView area, it starts jumping between the bottom of the view and its correct position. It should have been set to visible=false once it moved out of view, even if it's the current item. (The jumping doesn't occur if view transitions are not enabled.)

      The "original 1" item also jumps out of the view, instead of animating smoothly out of view. This is more obvious when you set clip=true and see the moment that it moves out of view.

      import QtQuick 2.0
      
      Item {
          width: 320; height: 480
      
          Timer {
              interval: 500; running: true; repeat: true
              onTriggered: model.insert(0, { "name": "Item " + model.count })
          }
      
          Rectangle {
              anchors.fill: listView
              color: "red"
              opacity: 0.1
          }
      
          ListView {
              id: listView
               width: 240; height: 200
               model: ListModel {
                   id: model
                   ListElement{name:"original 1"}
                   ListElement{name:"original 2"}
               }
      
               delegate: Rectangle {
                   width: 100; height: 30
                   border.width: 1
                   color: "lightsteelblue"
                   Text {
                       anchors.centerIn: parent
                       text: name
                   }
               }
      
               add: Transition {
                   NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 }
                   NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 }
               }
      
               addDisplaced: Transition {
                   NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutBounce }
               }
      
               focus: true
               Keys.onReturnPressed: timer.stop()
           }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes