Skip to main content

Widget

The root element of a component. A .qwidget file can contain exactly one Widget.

Signature

Attributes

UpdateTTL / RefreshTTL constants:
  • Default: launcher default (6 hours for updates; no automatic refresh)
  • Immediately: on every component mount
  • PreLaunch: once per launcher process
  • PreLoad: on every dashboard switch/remount
  • None: never
  • Number: seconds, e.g. 30 = 30 seconds

ImageHosts

Host allowlist for dynamic Image / Media sources and posters:
  • Exact hosts, *.example.com, and * are supported
  • The editor confirms ImageHosts once; images are not confirmed one by one
  • Static URLs do not require confirmation
  • ImageHosts="*" allows all HTTPS image/media hosts

Child elements

Direct children of Widget can be:
  • Layout/control nodes: Container, Row, Column, Grid, Text, Button, Dialog, and so on
  • Data
  • Resources
  • Triggers
  • Function
  • Widget.Using
  • Widget.Inputs / Widget.Outputs (widget contract)
Data can also appear inside any layout container; Resources, Triggers, and Function are only allowed at the root.

Attribute elements

Root attributes also accept the attribute-element syntax:

Runtime behavior

  1. Parse and strictly validate the XML: unknown elements/attributes, duplicate attributes, and invalid URLs/enums are hard errors.
  2. Parse Data and start fetching; parse Resources; parse Function/Triggers.
  3. Run the Loaded trigger.
  4. Render nodes; the parent reads the snapshot through Children; when Widget.Outputs is declared only Children.<As>.Outputs is exposed.
  5. Online components check for updates on a 6-hour TTL.

Limitations

  • XML ≤256KB, depth ≤16, elements ≤1000.
  • Data sources ≤8, nested instances ≤20.
  • An unnamed data source is named Data by default.