From 7a89d7f42337961363ce6c2ab399dbe1e1d1ef31 Mon Sep 17 00:00:00 2001 From: zxj <2472419499@qq.com> Date: Mon, 2 Dec 2024 17:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BB=E6=8A=97=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DependFile/QML/PopImpedance.qml | 292 ++++++++++++++++++ ZBD_IIIDL_S_Project/DependFile/QML/Ssvep.qml | 9 + .../DependFile/QML/impedanceDialog.qml | 161 ---------- ZBD_IIIDL_S_Project/image.qrc | 2 +- 4 files changed, 302 insertions(+), 162 deletions(-) create mode 100644 ZBD_IIIDL_S_Project/DependFile/QML/PopImpedance.qml delete mode 100644 ZBD_IIIDL_S_Project/DependFile/QML/impedanceDialog.qml diff --git a/ZBD_IIIDL_S_Project/DependFile/QML/PopImpedance.qml b/ZBD_IIIDL_S_Project/DependFile/QML/PopImpedance.qml new file mode 100644 index 0000000..db40aa2 --- /dev/null +++ b/ZBD_IIIDL_S_Project/DependFile/QML/PopImpedance.qml @@ -0,0 +1,292 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Popup { + id: impedancePopup // 弹出窗口的唯一标识 + x:510 + y:80 + + property string red: "#EE6352" + property string green: "#41B962" + property string yellow: "#F8C434" + + function show() { + impedancePopup.visible = true; + hitTimer.start() + } + function colorChange(index,color) { + + switch(index) { + case 1: + radius1.color=color + break; + case 2: + radius2.color=color + break; + case 3: + radius3.color=color + break; + case 4: + radius4.color=color + break; + case 5: + radius5.color=color + break; + case 6: + radius6.color=color + break; + case 7: + radius7.color=color + break; + case 8: + radius8.color=color + break; + case 9: + radius9.color=color + break; + case 10: + radius10.color=color + break; + } + } + 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: { + impedancePopup.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: radius1 + x:230 + y:170 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius2 + x:320 + y:180 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius3 + x:434 + y:167 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius4 + x:548 + y:180 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius5 + x:646 + y:167 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius6 + x:213 + y:310 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius7 + x:340 + y:300 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius8 + x:434 + y:308 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius9 + x:526 + y:300 + width: 32 + height: 32 + radius: 16 + color: red + } + Rectangle { + id: radius10 + x:655 + y:310 + width: 32 + height: 32 + radius: 16 + color: red + } + + + + + } + 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: { + impedancePopup.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: { + impedancePopup.visible = false; + } + + } + } + } +} + + diff --git a/ZBD_IIIDL_S_Project/DependFile/QML/Ssvep.qml b/ZBD_IIIDL_S_Project/DependFile/QML/Ssvep.qml index bfa240c..8df391d 100644 --- a/ZBD_IIIDL_S_Project/DependFile/QML/Ssvep.qml +++ b/ZBD_IIIDL_S_Project/DependFile/QML/Ssvep.qml @@ -877,12 +877,21 @@ Item { { anchors.fill: parent onClicked: { + popimpedance.show() } } } + PopImpedance{ + id:popimpedance + } + + + + + } diff --git a/ZBD_IIIDL_S_Project/DependFile/QML/impedanceDialog.qml b/ZBD_IIIDL_S_Project/DependFile/QML/impedanceDialog.qml deleted file mode 100644 index ab39191..0000000 --- a/ZBD_IIIDL_S_Project/DependFile/QML/impedanceDialog.qml +++ /dev/null @@ -1,161 +0,0 @@ -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; - } - - } - } - } -} - diff --git a/ZBD_IIIDL_S_Project/image.qrc b/ZBD_IIIDL_S_Project/image.qrc index 1e9276c..5aa2072 100644 --- a/ZBD_IIIDL_S_Project/image.qrc +++ b/ZBD_IIIDL_S_Project/image.qrc @@ -289,6 +289,6 @@ DependFile/Source/brainTrain/upTest3/upper_stretch_R16.png DependFile/Source/brainTrain/popup_Z_bg.png DependFile/Source/brainTrain/btn_Z.png - DependFile/QML/impedanceDialog.qml + DependFile/QML/PopImpedance.qml