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) } } }