title: QML - How to fit and align items of GridView?
body: <p>I want to fit all rectangles into <code>GridView</code>. I didn't use <code>GridLayout</code> because when I remove a rectangle from the <code>GridLayout</code>, they aligns again with <code>GridLayout</code>.<br />
  So I used <code>GridView</code> and my code:</p>
  
  <pre><code>import QtQuick 2.10
  import QtQuick.Window 2.10
  import QtQuick.Layouts 1.3
  
  Window {
    visible: true
    width: 420
    height: 720
    title: qsTr("Hello World")
  
  
    GridView {
      id: area
  
      // If device orientation is vertical, GridView shall be 4x(model/4)
      property int verticalChoice: (parent.width &lt; parent.height) ? 4 : 10
      //If device orientation is horizontal, GridView shall be (model/(model/4))x4
      property int horizontalChoice: (parent.width &gt; parent.height) ? 10 : 4
  
      width: cellWidth * verticalChoice
      height: cellHeight * horizontalChoice
      anchors.centerIn: parent
  
      cellWidth: (parent.width / verticalChoice)
      cellHeight: (parent.height / horizontalChoice)
  
      model: 40
      clip: true
      interactive: false
  
      delegate: Rectangle {
        id: rect
        width: area.cellWidth - 5
        height: area.cellHeight - 5
        color: 'red'
        Text {
          text: index
          color: 'white'
          anchors.centerIn: parent
        }
        MouseArea {
          anchors.fill: parent
          onClicked: rect.destroy(1000)
        }
      }
    }
  }
  </code></pre>
  
  <p>I set <code>model</code> of <code>GridView</code> as <code>40</code> and I set <code>interactive</code> as <code>false</code>. But I see just <code>15</code> items like this:<br>
  <a href="https://postimg.org/image/udaac4rt1/" rel="nofollow noreferrer"><img src="https://s10.postimg.org/b8712dd55/image.png" alt="image.png"></a><br />
  Also I wrote <code>anchors.centerIn: parent</code> but it didn't run. How can I do them (to fit and align)?</p>