Hello i would like to add different color on specific words of a string to be used in QML Text
Text {
text: "Blue Red Yellow Green"
}
I know that you can add color to the whole text, but i would like to add specific color on specific words. is this possible? and how is it achieved?
Go to Format > Font > Font. + D to open the Font dialog box. Select the arrow next to Font color, and then choose a color.
By default, Text will display the text as a single line unless it contains embedded newlines. To wrap the line, set the wrapMode property and give the text an explicit width for it to wrap to.
Text
items can display both plain and rich text. For example you can have:
Text {
text: "<font color=\"#0000FF\">Blue</font> <font color=\"#FF0000\">Red</font>"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With