Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface QML富文本颜色格式设置不起作用_User Interface_Qml_Richtext - Fatal编程技术网

User interface QML富文本颜色格式设置不起作用

User interface QML富文本颜色格式设置不起作用,user-interface,qml,richtext,User Interface,Qml,Richtext,富文本规范的颜色标签似乎在我的QML中不起作用。这是我的密码: Text { id: messageText x: /*tagText.width +*/ 4 width: logItem.width - 8//- tagText.width text: "<color=#FFFF0000>[RED TEXT]</color>white text

富文本规范的颜色标签似乎在我的QML中不起作用。这是我的密码:

Text {
                id: messageText
                x: /*tagText.width +*/ 4
                width: logItem.width - 8//- tagText.width
                text: "<color=#FFFF0000>[RED TEXT]</color>white text"
                color: "#ccc"
                wrapMode: Text.WrapAnywhere
                textFormat: Text.RichText
            }
文本{
id:messageText
x:/*tagText.width+*/4
宽度:logItem.width-8//-tagText.width
文本:“[红色文本]白色文本”
颜色:“ccc”
wrapMode:Text.WrapAnywhere
Text格式:Text.RichText
}

文本没有正确着色。只考虑文本对象的颜色属性。我尝试删除该标签,但仍然遇到相同的问题。

标签使用错误。以下是正确的方法:

text: "<font color=\"#FF0000\">[RED TEXT]</font>white text"
text:“[红色文本]白色文本”