C
StaticText QML Type
Enables optimized drawing of text. More...
Import Statement: | import QtQuickUltralite.Extras 2.8 |
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.
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.
Relation to font engines.
StaticText items are created by the fontcompiler at the application build-time. The glyph layout information that is included into StaticText data is queried from the applications selected font engine (MCU.Config.fontEngine).
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.
With static font engine the complex Unicode scripts can be rendered using StaticText items only.
Performance.
A StaticText item offers better performance compared to a Text item when no other optimizations have been applied. This is because StaticText does not need to do all the mentioned font handling operations at run-time, which can be very expensive.
Depending on the underlying hardware and the used optimization techniques, the Text item could outperform StaticText. See Qt Quick Ultralite Performance Guide and Text Rendering and Fonts for various techniques of optimizing Text items drawing performance. The advantage of StaticText items over Text items is that you do not need to rely on RAM resources to enable performance gains.
With static font engine, the Text vs StaticText item performance should be similar when no other optimizations have been applied. This is because Text item works with pre-rasterized set of glyphs and does not support text shaping.
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.