修改参数保存方式。
All checks were successful
Release tag / build (push) Successful in 2m19s

This commit is contained in:
luocai 2024-12-31 11:29:56 +08:00
parent d86a45680b
commit 21df3a8ee3

View File

@ -355,6 +355,16 @@ Item {
Layout.rightMargin: 20 Layout.rightMargin: 20
} }
} }
}
Label {
Layout.alignment: Qt.AlignTop
Layout.topMargin: 14
text: qsTr("阈值设置: ")
}
Flow {
Layout.fillHeight: true
Layout.fillWidth: true
RowLayout { RowLayout {
Label { text: qsTr("安全帽阈值: ") Label { text: qsTr("安全帽阈值: ")
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
@ -371,12 +381,6 @@ Item {
bottom: 0 bottom: 0
top: 300 top: 300
} }
onAccepted: {
if(App.currentHelmetThreshold !== parseInt(helmetInput.text)){
App.currentHelmetThreshold= parseInt(helmetInput.text)
window.showSuccess("设置成功",2500)
}
}
Layout.rightMargin: 20 Layout.rightMargin: 20
} }
} }
@ -397,12 +401,6 @@ Item {
bottom: 0 bottom: 0
top: 300 top: 300
} }
onAccepted: {
if(App.currentHeadThreshold !== parseInt(headInput.text)){
App.currentHeadThreshold= parseInt(headInput.text)
window.showSuccess("设置成功",2500)
}
}
Layout.rightMargin: 20 Layout.rightMargin: 20
} }
} }
@ -423,11 +421,23 @@ Item {
bottom: 0 bottom: 0
top: 30 top: 30
} }
onAccepted: { }
if(App.currentDetectFrameSize !== parseInt(detectFrameInput.text)){ }
App.currentDetectFrameSize= parseInt(detectFrameInput.text) Button {
window.showSuccess("设置成功",2500) 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)
} }
} }
} }