6 Star 19 Fork 24

韦东山 / Qtmxapp-desktop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
DeleteDialog.qml 2.77 KB
一键复制 编辑 原始数据 按行查看 历史
世玉轩 提交于 2020-06-19 09:31 . init push myir hmi v2.0 gui
import QtQuick 2.0
//预览界面删除对话框
Rectangle {
id: root
width: 240
height: width/2
color: "#363d43"
visible: false
border.color: "#e5e8ea"
border.width: 1
radius: 3
property color clr_entered: "darkgray"
property color clr_pressed: "dimgray"
property color clr_released: "black"
property color clr_exited: "black"
signal clicked_delete
signal clicked_cancel
Text {
id: infoText
text: qsTr("是否删除本张图片?")
color: "white"
font.pixelSize: 20
font.bold: true
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
anchors.horizontalCenter: root.horizontalCenter
anchors.top: root.top
anchors.topMargin: 30
}
Rectangle {
id: deleteButton
width: root.width/2
height: root.height/4
color: clr_exited
border.color: "white"
border.width: 0.5
radius: root.radius
Text {
text: qsTr("确定")
color: "white"
font.pixelSize: 20
font.bold: true
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
anchors.centerIn: parent
}
anchors.bottom: root.bottom
anchors.left: root.left
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
hoverEnabled: enabled
onClicked: root.clicked_delete()
onPressed: deleteButton.color = clr_pressed
onEntered: deleteButton.color = clr_entered
onExited: deleteButton.color = clr_exited
onReleased: deleteButton.color = clr_released
}
}
Rectangle {
id: cancelButton
width: root.width/2
height: root.height/4
color: clr_exited
border.color: "white"
border.width: 1
radius: root.radius
Text {
text: qsTr("取消")
font.pixelSize: 20
font.bold: true
color: "white"
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
anchors.centerIn: parent
}
anchors.bottom: root.bottom
anchors.right: root.right
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
hoverEnabled: enabled
onClicked: root.clicked_cancel()
onPressed: cancelButton.color = clr_pressed
onEntered: cancelButton.color = clr_entered
onExited: cancelButton.color = clr_exited
onReleased: cancelButton.color = clr_released
}
}
}
C++
1
https://gitee.com/weidongshan/Qtmxapp-desktop.git
git@gitee.com:weidongshan/Qtmxapp-desktop.git
weidongshan
Qtmxapp-desktop
Qtmxapp-desktop
master

搜索帮助