完善调试功能。
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Layouts
|
||||
import Analyser
|
||||
|
||||
@ -141,10 +143,23 @@ ColumnLayout {
|
||||
GroupBox {
|
||||
title: "图片注册"
|
||||
GridLayout {
|
||||
columns: 1
|
||||
columns: 2
|
||||
TextField {
|
||||
id: imagePath
|
||||
Layout.columnSpan: 2
|
||||
implicitWidth: 180
|
||||
placeholderText: "请选择图片"
|
||||
onPressed: {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
Button {
|
||||
text: "图片下发注册"
|
||||
onClicked: App.uploadImage()
|
||||
text: "注册"
|
||||
onClicked: App.uploadImage(imagePath.text, 0)
|
||||
}
|
||||
Button {
|
||||
text: "识别"
|
||||
onClicked: App.uploadImage(imagePath.text, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -176,15 +191,28 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
nameFilters: ["图片 (*.jpg *.yuv)"]
|
||||
currentFolder: StandardPaths.standardLocations(
|
||||
StandardPaths.DesktopLocation)[0]
|
||||
onAccepted: {
|
||||
var fileUrl = fileDialog.selectedFile.toString()
|
||||
var localFilePath = fileUrl.startsWith(
|
||||
"file:///") ? fileUrl.substring(8) : fileUrl
|
||||
imagePath.text = localFilePath
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
source: "OtaPage.qml"
|
||||
active: false
|
||||
onLoaded: {
|
||||
if (loader.item && loader.item.open) {
|
||||
loader.item.open();
|
||||
loader.item.onClose = ()=>{
|
||||
loader.active= false
|
||||
loader.item.open()
|
||||
loader.item.onClose = () => {
|
||||
loader.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user