Expand description
Input-mask grammar (Qt-compatible subset).
Adopts the well-known QLineEdit::setInputMask grammar so masks
that work in any Qt-based desktop app port over verbatim. Used by
TextInputField
to constrain typed input, render the empty-state template
(__/__/____ for 99/99/9999), and auto-insert literal separators
between editable positions.
§Grammar
| Char | Meaning |
|---|---|
9 | Required digit |
0 | Optional digit |
A | Required ASCII letter |
a | Optional ASCII letter |
N | Required alphanumeric |
n | Optional alphanumeric |
X | Any required character |
x | Any optional character |
H | Required hex digit |
h | Optional hex digit |
> | Uppercase the following editable chars (toggle) |
< | Lowercase the following editable chars (toggle) |
! | Cancel the case lock from > / < |
\X | Literal X (escape) |
Anything else is a fixed separator: 99/99/9999, (999) 999-9999,
>AA for force-uppercase 2-letter codes.
§Storage model
The bound Signal<String> observes the formatted text including
literal separators (matches Qt’s QLineEdit semantics): typing 12302026
into 99/99/9999 produces "12/30/2026", not "12302026". Apps that
need raw digits strip separators trivially with .replace('/', "").
Structs§
- Formatted
Mask - Result of
InputMask::format: the fully-templated string plus metadata about how much of the user’s input was consumed. - Input
Mask - Parsed mask: a sequence of positions, ready for rendering and per-character routing.
Enums§
- Case
Lock - Per-position case lock applied during typing.
- Mask
Class - Character classes that an editable position accepts.
- Mask
Error - Mask-parse errors. Currently only the trailing-backslash case; any other character becomes a fixed literal (Qt’s permissive behaviour) so most accidental “weird” masks just produce odd templates rather than parse failures.
- Mask
Position - One position in the parsed mask. Either the user provides a
character there (
Editable) or it’s a fixed literal that the field paints automatically and the caret skips over.