From 2830bae7cb5155a0c14425323ddb3228bad5aaf9 Mon Sep 17 00:00:00 2001 From: x-tools-author Date: Tue, 26 Mar 2024 16:41:10 +0800 Subject: [PATCH] chore: update files of project --- CMake/xToolsCommon.cmake | 2 +- CMakeLists.txt | 2 ++ Source/CANBusStudio/CANBusStudioUI/xToolsCanBusStudioUi.cpp | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CMake/xToolsCommon.cmake b/CMake/xToolsCommon.cmake index ab0f3df8..0737fcd7 100644 --- a/CMake/xToolsCommon.cmake +++ b/CMake/xToolsCommon.cmake @@ -1,5 +1,5 @@ add_compile_definitions(X_TOOLS_AUTHOR="x-tools-author") -add_compile_definitions(X_TOOL_EDITION="beta1") +add_compile_definitions(X_TOOLS_EDITION="beta1") add_compile_definitions(X_TOOLS_VERSION="5.1.0") add_compile_definitions(X_TOOLS_DEFAULT_APP_STYLE="Fusion") add_compile_definitions(X_TOOLS_CLEAR_MESSAGE_INTERVAL=8000) diff --git a/CMakeLists.txt b/CMakeLists.txt index f330366e..a966321d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,8 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "iOS") add_compile_definitions(X_TOOLS_IMPORT_MODULE_SERIALBUS) endif() +add_compile_definitions(X_TOOLS_BUILD_WITH_CMAKE) + find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS ${X_TOOLS_QT_COMPONENTS}) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${X_TOOLS_QT_COMPONENTS}) diff --git a/Source/CANBusStudio/CANBusStudioUI/xToolsCanBusStudioUi.cpp b/Source/CANBusStudio/CANBusStudioUI/xToolsCanBusStudioUi.cpp index 158e5f3a..93fd1764 100644 --- a/Source/CANBusStudio/CANBusStudioUI/xToolsCanBusStudioUi.cpp +++ b/Source/CANBusStudio/CANBusStudioUI/xToolsCanBusStudioUi.cpp @@ -54,10 +54,7 @@ void xToolsCanBusStudioUi::initUi() void xToolsCanBusStudioUi::initUiSelectPlugin() { ui->pluginComboBox->clear(); - QList plugins = QCanBus::instance()->plugins(); - for (const QByteArray& plugin : plugins) { - ui->pluginComboBox->addItem(QString::fromLatin1(plugin)); - } + ui->pluginComboBox->addItems(QCanBus::instance()->plugins()); ui->disconnectPushButton->setEnabled(false); ui->connectPushButton->setEnabled(true);