From e3d599fdf70bc6e43394a5fbb32e6278ec8483b5 Mon Sep 17 00:00:00 2001 From: luocai Date: Thu, 29 Aug 2024 18:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=A5=BD=E9=87=87=E9=9B=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=80=89=E6=8B=A9=E6=96=87=E4=BB=B6=E5=A4=B9=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- qml/Main.qml | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index deae87d..9eed951 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/qml/Main.qml b/qml/Main.qml index 653c63a..192839c 100644 --- a/qml/Main.qml +++ b/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 () {