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

GridView cuts off items patially

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • 5.6.1
    • 5.0.1
    • None
    • Qt 5.0.1 (official binaries) Linux

    Description

      By default GridView lays out its children from left to right and top to bottom. If there is not enough space on the right side, a new row is started.

      Unfortunately if the width of the GridView is not a multiple of the cellWidth the items on the right side are partially cut off as shown on the attached screenshot.

      Fully working example below:

      import QtQuick 2.0
      
      Rectangle {
          width: 900
          height: 600
          color: "gray"
      
          GridView {
              id: view
              model: 10
              clip: true
              cellWidth: 350
              cellHeight: 150
              anchors.fill: parent
              anchors.margins: 10
              delegate: Rectangle {
                  height: view.cellHeight
                  width: view.cellWidth
                  color: "lightblue"
                  border.color: "white"
                  Text {
                      anchors.centerIn: parent
                      text: index
                  }
              }
          }
      }
      

      Attachments

        1. with 5.6.1.png
          with 5.6.1.png
          19 kB
        2. GridView.png
          GridView.png
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            martinj Martin Jones
            conny Cornelius Hald
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes