Layout elements
QWidget layouts are built entirely from nested elements. There are no pixel properties likeWidth / Height / Margin; size is decided by the dashboard grid and the layout containers.
Container types
Container
Use
Container for cards; when you only want arrangement without visuals, use Row / Column.
Row / Column
Grid
Children support attached properties:
Grid.Row: starts at 0Grid.Column: starts at 0Grid.RowSpan: default 1Grid.ColumnSpan: default 1
Tabs
Tabs.Default: initially selected index, 0-based.TabItem.Title: tab title, required.- Selection lives in memory only and is not persisted.
- All
TabItemelements are parsed on mount, andDatais prefetched too, so switching tabs does not flash.
List
Items: array path, required; either{Data.Items}orData.Items.As: item variable name, defaults toitem(case-sensitive).ListItem: exactly one is required, and it may contain only one root element.- Inside an item you can use
{Item.Xxx}and{Index}. - At most 200 items are rendered; an empty array shows
EmptyText.
If
Test is a truthiness check: False / empty string / 0 / null / empty array count as false.
Divider / Spacer
Divider: a 1px separator line.Spacer: fixed pixel spacing; it sets both width and height, so it works horizontally and vertically.
Page content
Container, Row, Column, Grid, If, Tabs, TabItem, List, and ListItem can use Content="{PageName}" instead of inline children:
Content and child elements are mutually exclusive; see Page system.
Adaptive sizing
A custom widget renders inside a dashboard grid cell whose width and height change when the user resizes it:- Top-level
Container/Row/Column/Grid/Tabs/Liststretch to the cell height;Text,Button, and similar nodes keep their content height. - The widget scrolls when content exceeds the cell; a top-level
ListorTabscontent area scrolls internally first. - Wrap the whole card in one top-level
ContainerorColumnso its background/border fills the cell; multiple top-level nodes follow content height and may leave empty space below. Justify="Between"separates top and bottom content;Row Wrap="True"reflows when the cell gets narrower.Gridcolumns are fixed and do not change with width; use fewerColumnsorRow Wrapfor narrow cards.
Declarative breakpoints
When supports Size.Width / Size.Height / Size.PixelWidth / Size.PixelHeight with <, <=, >, >=, ==, !=, joined by and / or. In XML attributes, write < as <.
Script breakpoints
Resize fires after a debounce when size changes; use a Loaded function to read the initial Size.
Common layouts
Two-column splitLimits and gotchas
- A container’s content is its children; do not put bare text directly inside a container.
Gridattached properties only apply to direct children.- There is no pixel width or height: the widget size is decided by the dashboard grid cell. If you need internal scrolling, handle it in the outer widget.
- Deep nesting and long lists slow down rendering; the per-widget element limit is 1000.