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

GridView doesn't repaint if resized after creation

    XMLWordPrintable

Details

    • b71363fda9822fab6d7fb93143173c6ba4cb8aa3

    Description

      With the following code, press Return to change the GridView height to 400. It should now display all 8 items in the model, but instead, it will not render them until the view is flicked or otherwise triggered to do a repaint.

      import QtQuick 2.0
      
      Rectangle {
      
          width: 300; height: 400
      
          GridView {
              id: imageGrid
      
              width: 300; height: 100
      
              model: ListModel {
                  ListElement {}
                  ListElement {}
                  ListElement {}
                  ListElement {}
                  ListElement {}
                  ListElement {}
                  ListElement {}
                  ListElement {}
              }
      
              delegate: Rectangle {
                  x: 2; y: 2; width: 96; height: 96
                  border.width: 1
                  color: "yellow"
              }
      
              focus: true
              Keys.onReturnPressed: imageGrid.height = 400
          }
      }
      

      Attachments

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

        Activity

          People

            bealam Bea Lam (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