From 21df3a8ee391be622d6b131fee51f4315b73c0c3 Mon Sep 17 00:00:00 2001 From: luocai Date: Tue, 31 Dec 2024 11:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=96=B9=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/DeviceView.qml | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/qml/DeviceView.qml b/qml/DeviceView.qml index 1fc36f3..c679e1e 100644 --- a/qml/DeviceView.qml +++ b/qml/DeviceView.qml @@ -355,6 +355,16 @@ Item { Layout.rightMargin: 20 } } + } + + Label { + Layout.alignment: Qt.AlignTop + Layout.topMargin: 14 + text: qsTr("阈值设置: ") + } + Flow { + Layout.fillHeight: true + Layout.fillWidth: true RowLayout { Label { text: qsTr("安全帽阈值: ") Layout.alignment: Qt.AlignRight @@ -371,12 +381,6 @@ Item { bottom: 0 top: 300 } - onAccepted: { - if(App.currentHelmetThreshold !== parseInt(helmetInput.text)){ - App.currentHelmetThreshold= parseInt(helmetInput.text) - window.showSuccess("设置成功",2500) - } - } Layout.rightMargin: 20 } } @@ -397,12 +401,6 @@ Item { bottom: 0 top: 300 } - onAccepted: { - if(App.currentHeadThreshold !== parseInt(headInput.text)){ - App.currentHeadThreshold= parseInt(headInput.text) - window.showSuccess("设置成功",2500) - } - } Layout.rightMargin: 20 } } @@ -423,11 +421,23 @@ Item { bottom: 0 top: 30 } - onAccepted: { - if(App.currentDetectFrameSize !== parseInt(detectFrameInput.text)){ - App.currentDetectFrameSize= parseInt(detectFrameInput.text) - window.showSuccess("设置成功",2500) - } + } + } + Button { + enabled: root.enabled + text: "保存" + onClicked: { + if(App.currentHelmetThreshold !== parseInt(helmetInput.text)){ + App.currentHelmetThreshold= parseInt(helmetInput.text) + window.showSuccess("安全帽阈值设置成功",2500) + } + if(App.currentHeadThreshold !== parseInt(headInput.text)){ + App.currentHeadThreshold= parseInt(headInput.text) + window.showSuccess("头肩阈值设置成功",2500) + } + if(App.currentDetectFrameSize !== parseInt(detectFrameInput.text)){ + App.currentDetectFrameSize= parseInt(detectFrameInput.text) + window.showSuccess("识别帧数设置成功",2500) } } }