Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hello, Is it possible to have different colors for the same QML Text component? I want a specefic color for my text last character.
@Babs QML and Text components support rich text formatting so something like this can work:
Text { anchors.fill:parent text: "Normal text <font color=\"#FF0000\">this part is red</font>" }
@J-Hilk can it work when my text are QString variables?
@Babs sure, you can reformat your strings to include the tags or do something like this
Text { anchors.fill:parent text: "%1<font color=\"#FF0000\">%2</font>".arg(stringA).arg(stringB) }
@J-Hilk thank you