【qml】QML元素使用范例-自定义按钮外观

Button{
style: ButtonStyle{
background: Rectangle{
radius: 4
color: control.pressed ? “#2a5566” : “#1a353e”
border.color: control.activeFocus ? “red” : “transparent”
}
label: Text{
text: control.text
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.family: “Microsoft YaHei UI Light”
font.pixelSize: 28
font.letterSpacing: 0
font.wordSpacing: 0
}
}
}

你可能感兴趣的:(【qml】QML元素使用范例-自定义按钮外观)