官方demo
import QtQuick
import QtQuick.Controls
ApplicationWindow {
width: 400
height: 400
visible: true
Button {
id: button
text: "A Special Button"
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
color: button.down ? "#d6d6d6" : "#f6f6f6"
border.color: "#26282a"
border.width: 1
radius: 4
}
}
}
为了明显一点我们将颜色修改为color: button.down ? “red” : “blue” ,radius: 10
启动后发现正常情况符合预期,但是hover状态和press状态后,会先显示预期然后渐变为默认样式,如图
如果使用5.15.2的编辑器就会解决这个问题,不知道这个是不是6.2.4的bug还是新特性,要求一种新的使用习惯。
题,不知道这个是不是6.2.4的bug还是新特性,要求一种新的使用习惯。