import QtQuick 2.0 import QtQuick.Controls 2.0 Popup { id: popup // 弹出窗口的唯一标识 x:510 y:80 function show() { popup.visible = true; } width: bgRect.width height: bgRect.height background: Item { implicitWidth: bgRect.width implicitHeight: bgRect.height } modal: true focus: true closePolicy: /*Popup.CloseOnEscape | */Popup.CloseOnPressOutsideParent // 弹出窗口的内容项 Rectangle { id: bgRect width: 900 height: 720 radius: 20 x:0 y:0 color: "#FFFFFF" // 设置矩形的背景颜色 // 文本显示在矩形中 //标题 Rectangle { id: titleRect width: parent.width height: 120 color: "#F5F7F9" radius: parent.radius Text { id: titleText color: "#333333" font.pixelSize: 24 text: qsTr("阻抗") font.weight: Font.Bold anchors.left: parent.left anchors.leftMargin: 30 anchors.verticalCenter: parent.verticalCenter z:2 } Image { id: closeImg source: "qrc:DependFile/Source/dialog/close.png" sourceSize: Qt.size(34,34) anchors.right: parent.right anchors.rightMargin: 50 anchors.verticalCenter: parent.verticalCenter MouseArea { anchors.fill: parent onClicked: { popup.visible = false; } } } } Rectangle { id: buttonRect x:0 y:100 width: parent.width height: 600 color: "#FFFFFF" Text { id: buttonText color: "#666666" font.pixelSize: 20 text: qsTr("请保存安静,正在进行阻抗检测") y:44 anchors.horizontalCenter: parent.horizontalCenter z:2 } Image { id: impedanceImg source: "qrc:/DependFile/Source/brainTrain/popup_Z_bg.png" sourceSize: Qt.size(602,290) y:114 anchors.horizontalCenter: parent.horizontalCenter } } Rectangle { id: cancel x:270 y:600 width: 160 height: 64 color: "#FFFFFF" border.color: "#0D9DDB" border.width:1 radius:8 Text { id: cancelText color: "#0D9DDB" font.pixelSize: 28 font.weight: Font.Bold text: qsTr("取消") anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter z:2 } MouseArea { anchors.fill: parent onClicked: { popup.visible = false; } } } Rectangle { id: confirm x:470 y:600 width: 160 height: 64 color: "#0D9DDB" radius:8 Text { id: confirmText color: "#FFFFFF" font.pixelSize: 28 font.weight: Font.Bold text: qsTr("确定") anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter z:2 } MouseArea { anchors.fill: parent onClicked: { popup.visible = false; } } } } }