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

QML GridView cuts off delegates on resize.

    XMLWordPrintable

Details

    • qtdeclarative/stable: fd9d0ea

    Description

      When using GridView within a resizable window, the delegates get cut off at a random point in their horizontalCenter.

      See here: http://www.youtube.com/watch?v=dBJkzE4sh1Y

      Notice that the red rectangles do not jump down to the next line immediately once there isn't enough space to display them. The Grid positioner element does this perfectly though.

      In my example, the Grids cellWidth is set to 125 while the rectangle delegates width is set to 120.

      Heres a much simpler example:

      When in QMLScene, drag the right side of the window to the left and watch how you have to be more than 50% of the way into a rect in order for it to drop down to another line.

      import QtQuick 2.0
      
      Rectangle { // Main Window
          id: mainWindowBase
          width: 300
          height: 200
          color: "transparent"
      
          GridView {
              id: gridd
              width: parent.width
              height: parent.height
      
              model: contactModel
              delegate: Rectangle {
                  height: gridd.cellHeight - 5
                  width: gridd.cellWidth - 5
                  color: kolor
                  Text {
                      id: label
                      text: qsTr(name)
                      anchors.centerIn: parent
                  }
              }
          }
      
          ListModel {
              id: contactModel
              ListElement {
                  name: "Jim Williams"
                  kolor: "yellow"
              }
              ListElement {
                  name: "John Brown"
                  kolor: "red"
              }
              ListElement {
                  name: "Bill Smyth"
                  kolor: "green"
              }
              ListElement {
                  name: "Sam Wise"
                  kolor: "blue"
              }
          }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-29822
        # Subject Branch Project Status CR V

        Activity

          People

            Unassigned Unassigned
            think7 Andrew Ialacci
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes