C
StaticText QML Type
Enables optimized drawing of text. More...
Import Statement: | import QtQuickUltralite.Extras 2.9 |
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 in the following sections. For more info. see Text QML type documentation.
To be able to prepare the text at the application build-time, StaticText requires the text property is a constant and known at compile-time. It must be either a string literal, or a translated literal like qsTr("text")
. StaicText supports constant font configurations only, which means it doesn't support dynamic text.
Relation to font engines
The fontcompiler
creates the StaticText items at the application build-time. The font engine (MCU.Config.fontEngine) chosen by the application, uses the glyph layout information in the StaticText data.
StaticText always shapes and rasterizes the text at application build-time. It doesn't use any of the font engine APIs at run-time.
You can also use StaticText to render complex Unicode scripts with the static font engine.
Performance
A StaticText item offers better performance in comparison to a Text item with no optimizations. This is because StaticText doesn't do font-specific operations at run-time, which can be very expensive.
Depending on the underlying hardware and optimizations, a Text item could outperform StaticText. See Qt Quick Ultralite Performance Guide and Text Rendering and Fonts for various techniques to optimize performance of Text items. The StaticText items have a slight advantage over Text items as they don't depend on RAM for performance gains.
The Text and StaticText items behave the same with static font engine, if there are no optimizations. This is because both of them use pre-rasterized glyphs.
Memory.
See MCU.Config.glyphsCachePolicy, MCU.Config.glyphsStorageSection, and // MCU.Config.glyphsRuntimeAllocationType 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.