Liri Fluid API

AutomaticGrid QML Type

Lay out children in a grid that automatically fits the available space. More...

Import Statement: import Fluid.Layouts 1.1


Detailed Description

  import QtQuick 2.10
  import Fluid.Layouts 1.0 as FluidLayouts

  Item {
      width: 600
      height: 600

      FluidLayouts.AutomaticGrid {
          anchors.fill: parent
          cellWidth: 100
          cellHeight: cellWidth
          model: 20

          delegate: Rectangle {
              id: item
              height: 100.0 * Math.random()
              color: Qt.rgba(Math.random(), Math.random(), Math.random(), Math.random())
              Text {
                  text: index

Property Documentation

cellHeight : real

Cell height.

cellWidth : real

Cell width.

[default] delegate : Component

The delegate provides a template defining each item istantiated by the grid.

See also Repeater::delegate.

heightOverride : real

Maximum height.

minColumnSpacing : real

Minimum spacing between columns.

model : any

The model providing data to the grid.

This property can be set to any of the supported data models.

See also Repeater::model.

widthOverride : real

Maximum width.