C

StaticText QML Type

Enables optimized drawing of text. More...

Import Statement: import QtQuickUltralite.Extras 2.3
Since: Qt Quick Ultralite 1.0

Detailed Description

StaticText in most ways, behaves like Text and has the same properties as Text, except the differences that are documented on this page or under respective properties in Text item's documentation.

Text that is displayed using the StaticText type is always shaped and rasterized at application build-time. It does not rely on calling any of the font engine APIs at run-time.

To be able to prepare the text at the application build-time, StaticText requires the text property to be fixed and known at compile-time. It must be either a string literal, or a translated literal like qsTr("text"). And it supports only constant font configurations for the same reason. StaticText can not be used for dynamic text.

A StaticText item offers better performance compared to a Text item, because it does not need to do all the mentioned font handling operations, which can be very expensive.

Note: With static font engine, the Text vs StaticText item performance should be similar, as Text item works with pre-rasterized set of glyphs and does not support text shaping. Complex Unicode scripts can be rendered using StaticText items only, if the application is configured with static font engine.

See QUL_GLYPHS_RESOURCE_CACHE_POLICY, QUL_GLYPHS_RESOURCE_STORAGE_SECTION, and QUL_GLYPHS_RESOURCE_RUNTIME_ALLOCATION_TYPE for more information about configuring the run-time storage of StaticText glyphs.

See also Text Rendering and Fonts, Text QML Type, and Text.

Available under certain Qt licenses.
Find out more.