我的页面有一个背景图像,我想在单击背景时实现某种页面刷新。但是,我没有在 QT quick 中找到图像元素的任何操作。
实现这一点的正确方法是什么?
您需要使用MouseArea来处理点击事件。
Image {
source: "myimage.png"
MouseArea {
anchors.fill: parent
onClicked: {
// do what you want here
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2557 次 |
| 最近记录: |