Skip to main content

Layout elements

QWidget layouts are built entirely from nested elements. There are no pixel properties like Width / 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 0
  • Grid.Column: starts at 0
  • Grid.RowSpan: default 1
  • Grid.ColumnSpan: default 1
Attached properties can be written as attributes or as property elements:
When no row or column is given, children fill the grid in flow order.

Tabs

  • Tabs.Default: initially selected index, 0-based.
  • TabItem.Title: tab title, required.
  • Selection lives in memory only and is not persisted.
  • All TabItem elements are parsed on mount, and Data is prefetched too, so switching tabs does not flash.

List

  • Items: array path, required; either {Data.Items} or Data.Items.
  • As: item variable name, defaults to item (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 / List stretch to the cell height; Text, Button, and similar nodes keep their content height.
  • The widget scrolls when content exceeds the cell; a top-level List or Tabs content area scrolls internally first.
  • Wrap the whole card in one top-level Container or Column so 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.
  • Grid columns are fixed and do not change with width; use fewer Columns or Row Wrap for narrow cards.

Declarative breakpoints

When supports Size.Width / Size.Height / Size.PixelWidth / Size.PixelHeight with <, <=, >, >=, ==, !=, joined by and / or. In XML attributes, write < as &lt;.

Script breakpoints

Resize fires after a debounce when size changes; use a Loaded function to read the initial Size.

Common layouts

Two-column split
Two-column cards

Limits and gotchas

  • A container’s content is its children; do not put bare text directly inside a container.
  • Grid attached 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.