C
string QML Value Type
a free form text string. More...
- string is part of Qt for MCUs QML Basic Types.
Detailed Description
The string type refers to a free form text in quotes, for example, "Hello world!".
Example:
Text { text: "Hello world!" }Strings have a length attribute that holds the number of characters in the string.
The Qt Quick Ultralite string object extends the Javascript String object with the arg() function.
Example:
Text {
property string message: "There are %1 items"
property int count: 20
text: message.arg(count)
}Note: The following usages of arg() function are not supported in Qt Quick Ultralite:
- Nested arg calls
Text { text: "%1".arg("%1".arg("Hello")) // "Hello" } - Dynamically replacing numbered place marker
Text { text: "%0 %1".arg("%1").arg("Hello") // "Hello Hello" }Note: You can achieve the above with an alternative qml syntax.
Example:
This basic type is provided by the QML language.
See also JavaScript environment for Qt Quick Ultralite applications.
Available under certain Qt licenses.
Find out more.