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

ListView components cannot be dynamically resized correctly before first flick

    XMLWordPrintable

Details

    • 768209aebcbc66fec3a600be0a0f0e58d9f405d8

    Description

      In the modelviews/listview/expandingdelegates.qml (recipes) example, clicking on a recipe should expand it to the full dimensions of the view. However, the recipe doesn't expand to the full height of the view if the list has not yet been flicked. Once it has been flicked, the items will expand correctly.

      Here is a standalone example:

      import Qt 4.7
      
      ListView {
          id: flick
          width: 150; height: 180
      
          model: ListModel {
              ListElement {}
              ListElement {}
              ListElement {}
              ListElement {}
              ListElement {}
          }
      
          delegate: Rectangle {
              id: rect
              width: 100; height: 50; border.width: 1
              Text { text: index+1 }
              MouseArea {
                  anchors.fill: parent
                  onClicked: parent.state = (parent.state == "expanded" ? '' : 'expanded')
              }
              states: State {
                  name: "expanded"
                  PropertyChanges { target: rect; height: flick.height; width: flick.width }
                  PropertyChanges { target: flick; contentY: rect.y; explicit: true }
              }
              transitions: Transition {
                  NumberAnimation { duration: 300; properties: "contentY,height,width" }
              }
          }
      }
      

      I'm guessing the problem is in ListView rather than Flickable, since I don't see the same problem with
      a Column of Rectangles inside a Flickable.

      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)
            bealam Bea Lam (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes