【发布时间】:2017-04-10 22:44:33
【问题描述】:
我是 QML 的新手,我想个性化我的按钮。我成功改变了背景颜色和边框颜色。但我根本没有成功改变按钮文本的颜色。我看到我们不再使用“样式”来更改样式,而是使用“背景”,我不了解它的所有内容。
感谢您的帮助。
Button {
id: buttonAC
text: qsTr("AC")
Layout.fillHeight: true
Layout.fillWidth: true
background: Rectangle {
border.color: "#14191D"
color: "#24292f"
// I want to change text color next
}
/*Text {
text: qsTr("AC")
color: "#F54035"
}*/
}
【问题讨论】:
-
您只需打开the documentation 或this
-
谢谢您,它解决了我的问题,我多次阅读此文档,但没有检索到好的信息。但是文档里写的很清楚。
标签: qt qml qtquick2 qtquickcontrols2