Fluid 1.3.0
Material Design for QtQuick and Qml
Loading...
Searching...
No Matches
AutomaticGridLayout Class Reference

Lay out children in equal adaptive cells that fit the available space. More...

Inheritance diagram for AutomaticGridLayout:

Detailed Description

Lay out children in equal adaptive cells that fit the available space.

AutomaticGridLayout is a Fluid layout utility influenced by AndroidX adaptive grid cells. It is not a standalone Material 3 component. Add items directly to it and use the standard Layout attached properties to control how each item participates in the grid.

Since it derives from GridLayout, flow, layoutDirection, spans, alignment, margins, and fill behavior follow the Qt Quick Layouts contract.

The minimum cell size is inferred from the largest effective preferred or implicit size of the visible children. Remaining space is distributed over equal tracks while columnSpacing and rowSpacing remain exact. Assign cellWidth or cellHeight to override the inferred value.

It can be declared directly inside a GroupBox. In the default left-to-right flow, the available width determines the column limit and additional items increase the implicit height. Top-to-bottom flow uses the available height as the row limit and increases the implicit width.

For more information about the adaptive-cell behavior, see GridCells.Adaptive.

import QtQuick
import QtQuick.Layouts
import Fluid as Fluid
Fluid.AutomaticGridLayout {
width: 600
Rectangle {
Layout.preferredWidth: 100
Layout.preferredHeight: 100
}
Rectangle {
Layout.preferredWidth: 100
Layout.preferredHeight: 100
}
}
See also
GridLayout, GroupBox

Definition at line 53 of file AutomaticGridLayout.qml.


The documentation for this class was generated from the following file: