How to add color on specific words on QML Text

前端 未结 1 1217
耶瑟儿~
耶瑟儿~ 2020-12-11 20:50

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\"

}
相关标签:
1条回答
  • 2020-12-11 21:26

    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>"
    }
    
    0 讨论(0)
提交回复
热议问题