ZSymbol¶
Tui Widgets uses strings as identifiers in various places. Using strings is helpful for namespace management when multiple independent developers create libraries and identfiers are widely scoped. To reduce possible performance impact of many string comparisons, strings are converted to ZSymbol instances. The ZSymbol system maintains an internal mapping of all strings used as symbols to integer values, so that simple integer comparisons can be done after lookup.
ZSymbol is used for storage and in places where implicit conversation from QString is not desired. In contrast ZImplicitSymbol can be used where ease of use requires implicit conversion.
-
TUISYM_LITERAL(x)¶
Creates a static
Tui::ZSymbol
symbol instance from the string literalx
.Example:
widget.getColor(TUISYM_LITERAL("control.fg"))