【发布时间】:2017-06-14 08:52:52
【问题描述】:
我想设计如下按钮布局:
它有一个位于蓝色背景之上的重启按钮图像。我想使用 QML 在 Qt 中复制相同的内容。我正在使用 MouseArea Qt Quick 对象,我在 Stretch 填充模式下重叠图像。但是,没有为鼠标区域获得蓝色背景的选项。目前它看起来像这样:
相同的对应代码:
MouseArea {
id: restartbutton
x: 669
width: 50
height: 50
opacity: 1
antialiasing: false
hoverEnabled: true
anchors.top: parent.top
anchors.topMargin: 8
z: 1
Image {
id: image2
anchors.fill: parent
source: "restart_icon.png"
}
}
如何在此处设置 MouseArea 的背景?
【问题讨论】: