更好采集数据选择文件夹方式。
This commit is contained in:
parent
72cdbd8d98
commit
e3d599fdf7
@ -1,6 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(AntiClipSettings VERSION 1.1 LANGUAGES C CXX)
|
||||
project(AntiClipSettings VERSION 1.2 LANGUAGES C CXX)
|
||||
set(APPLICATION_NAME "视觉防夹设备上位机工具")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
11
qml/Main.qml
11
qml/Main.qml
@ -21,6 +21,8 @@ ApplicationWindow {
|
||||
onClicked: {
|
||||
deviceList.currentIndex = -1
|
||||
App.startSearchDevice()
|
||||
App.collector.stop() // 停止数据采集
|
||||
App.collector.path=""
|
||||
}
|
||||
}
|
||||
Label {
|
||||
@ -87,8 +89,9 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
onCurrentIndexChanged: {
|
||||
// deviceVersion.text = App.devices.get(deviceList.currentIndex).softwareVersion;
|
||||
App.connectToDevice(deviceList.currentIndex)
|
||||
App.collector.stop() // 停止数据采集
|
||||
App.collector.path=""
|
||||
}
|
||||
ProgressBar {
|
||||
anchors.left: parent.left
|
||||
@ -213,14 +216,16 @@ ApplicationWindow {
|
||||
function showFolderDialog(onSelected) {
|
||||
let dialog = null
|
||||
if (isQt5) {
|
||||
dialog = Qt.createQmlObject("import Qt.labs.platform 1.1; FolderDialog {}", window, "myDynamicSnippet")
|
||||
dialog = Qt.createQmlObject("import QtQuick.Dialogs 1.3; FileDialog {}", window, "myDynamicSnippet")
|
||||
dialog.selectExisting = true
|
||||
dialog.selectFolder = true
|
||||
} else {
|
||||
dialog = Qt.createQmlObject("import QtQuick.Dialogs; FolderDialog {}", window, "myDynamicSnippet")
|
||||
}
|
||||
if (dialog) {
|
||||
dialog.visible = true
|
||||
dialog.accepted.connect(function () {
|
||||
onSelected(isQt5 ? dialog.folder : dialog.selectedFolder)
|
||||
onSelected(isQt5 ? dialog.fileUrl : dialog.selectedFolder)
|
||||
dialog.destroy()
|
||||
})
|
||||
dialog.rejected.connect(function () {
|
||||
|
Loading…
Reference in New Issue
Block a user