Skip to main content

QWidget XML syntax

A QWidget is a single XML file. The root element is always Widget; other elements cover layout, controls, data/resources, triggers, functions, and nested references.

Root element

Naming

All elements, attributes, and enum values use PascalCase:
  • Elements: Container, Text, TextBox, Widget.Using
  • Attributes: Value, Size, OnClick, EmptyText
  • Enums: Lg, Bold, Center, Json, Binary

Common node attributes

Except for the Widget root and non-visual elements such as Data, Resources, Function, and Triggers, every visual node supports: Target and an input control’s Name are separate namespaces: Name still drives {Inputs.Name} and Trigger Control="Name", while Target only addresses the UI from scripts. See Attribute values for all allowed values. Example:
When supports Size.Width / Size.Height / Size.PixelWidth / Size.PixelHeight, operators <, <=, >, >=, ==, !=, joined by and / or; write < as &lt; in XML attributes. See Functions and TypeScript for script examples.

Three equivalent syntaxes

The same property can be written as attribute syntax, content syntax, or property-element syntax. Setting the same property twice is an error.
ContentProperty mapping: Property elements can be combined with content:

Attached properties

Direct children of Grid support Grid.Row, Grid.Column, Grid.RowSpan, and Grid.ColumnSpan:

Bindings

String attributes support {path} interpolation. When the whole value is a binding, the original type is preserved. See Data binding.

Element overview

Actions

Buttons, links, and triggers use OnClick / OnChange / Action: Launch, SetDefaultInstance, OpenInstance, Navigate, OpenUrl, OpenFolder, Copy, SelectAccount, Install, Refresh, CallFunction, RunCommand, PluginApi. See Actions.

Limits

  • XML ≤256KB, depth ≤16, elements ≤1000.
  • Data sources ≤8; rendered list items ≤200.
  • Online text ≤1MB, binary ≤8MB; local binary ≤8MB.
  • Nesting depth ≤5; ≤20 nested instances per parent.
  • Function scripts ≤64KB; default timeout 3 seconds, max 10 seconds.
  • DOCTYPE / ENTITY are rejected; unknown elements/attributes and duplicate properties fail validation.