From fb2ca87ad7a57be787bad5848d48b7cb04ceaf47 Mon Sep 17 00:00:00 2001 From: Ake Hedman Date: Fri, 20 Sep 2024 12:20:26 +0200 Subject: [PATCH] Testing workspace action to build 6.2 based version --- .github/workflows/cmake.yml | 8 +- .vscode/tasks.json | 8 +- CMakeLists.txt | 138 ++---------------------------- src/cdlgconnsettingssocketcan.cpp | 9 +- src/cfrmnodeconfig.cpp | 4 +- src/cfrmsession.cpp | 8 +- src/mainwindow.cpp | 12 +-- 7 files changed, 26 insertions(+), 161 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d70872a6..64dc8643 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -21,7 +21,9 @@ jobs: uses: jurplel/install-qt-action@v4 with: version: 6.2.* + target: 'desktop' dir: ${{ github.workspace }}/qt/ + modules: 'qtcharts qtconnectivity qtserialbus qtserialport qtwebsockets' # https://github.com/actions/checkout - uses: actions/checkout@v4 @@ -66,8 +68,8 @@ jobs: - name: Install paho manually run: cd paho && mkdir build && cd build && sudo cmake -DPAHO_WITH_SSL=true .. && sudo make install - - name: Install qt5 components manually - run: sudo apt install qttools5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtdeclarative5-dev libqt5charts5-dev libqt5serialbus5-dev libqt5serialport5-dev + # - name: Install qt5 components manually + # run: sudo apt install qttools5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qtdeclarative5-dev libqt5charts5-dev libqt5serialbus5-dev libqt5serialport5-dev - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 @@ -75,7 +77,7 @@ jobs: - name: Create Build Environment run: | mkdir build && cd build - cmake -DCMAKE_INSTALL_PREFIX=/usr -DVSCP_ROOT=${{github.workspace}}/vscp/ -DVSCP_PATH=${{github.workspace}}/vscp/ -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Qt/6.7.2/gcc_64 .. + cmake -DCMAKE_INSTALL_PREFIX=/usr -DVSCP_ROOT=${{github.workspace}}/vscp/ -DVSCP_PATH=${{github.workspace}}/vscp/ -DCMAKE_PREFIX_PATH=${{ QT_ROOT_DIR }} .. - name: Build working-directory: ${{github.workspace}}/build diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a9d8c9cb..90cf1b5e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,7 +15,7 @@ { "taskName": "build", "type": "shell", - "command": "cd build; make -j8 -Wall", + "command": "cd build; make -j4 -Wall", "args": [], "group": "build", "problemMatcher": "$gcc", @@ -47,7 +47,7 @@ { "taskName": "Clean & build all 5.15.2", "type": "shell", - "command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/5.15.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j8 -Wall", + "command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/5.15.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4 -Wall", "args": [], "group": { "kind": "build", @@ -72,7 +72,7 @@ { "taskName": "Clean & build all 6.6.2", "type": "shell", - "command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.6.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j8", + "command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.6.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4", "args": [], "group": "build", "problemMatcher": { @@ -95,7 +95,7 @@ { "taskName": "Clean & build all 6.7.2", "type": "shell", - "command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j8", + "command": "cd build; make clean; export CMAKE_PREFIX_PATH=~/Qt/6.7.2/gcc_64:$CMAKE_PREFIX_PATH; cmake -DCMAKE_BUILD_TYPE=Debug .. ; make -j4", "args": [], "group": "build", "problemMatcher": { diff --git a/CMakeLists.txt b/CMakeLists.txt index 5afe8621..b7a35a40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,7 +62,6 @@ message(STATUS "VSCP path = $ENV{VSCP_ROOT}") if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-DWIN32_LEAN_AND_MEANS) - #add_definitions(-DOPENSSL_API_1_1) add_definitions(-D_POSIX_C_SOURCE) add_definitions(-DVCPKG_TARGET_TRIPLET=x64-windows) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -72,8 +71,7 @@ elseif(UNIX) endif() if (MSVC) -# # use precompiled headers -# set (CMAKE_AUTOMOC_MOC_OPTIONS "-bpch.h" "-fpch.h") +# use precompiled headers set (CMAKE_AUTOMOC_MOC_OPTIONS "-bpch.h ") endif() @@ -87,7 +85,6 @@ set(CMAKE_AUTORCC ON) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) # qt -#xxxfind_package(Qt5 5.15 COMPONENTS Widgets LinguistTools REQUIRED Core Network Sql Charts Quick SerialBus SerialPort) find_package(Qt6 REQUIRED COMPONENTS Widgets Qml Core Network Sql Charts Quick SerialBus SerialPort) qt_standard_project_setup() @@ -196,102 +193,6 @@ if(NOT SSL_VER_POS EQUAL -1) message(STATUS "Open ssl version is 3.3") endif() -# set(UI ) -#qt5_wrap_ui(UI src/mainwindow.ui -# src/cdlgmainsettings.ui -# src/cdlgconnsettingscanal.ui -# src/cdlgconnsettingstcpip.ui -# src/cdlgconnsettingssocketcan.ui -# src/cdlgconnsettingsmqtt.ui -# src/cdlgconnsettingsws1.ui -# src/cdlgconnsettingsws2.ui -# src/cdlgconnsettingsudp.ui -# src/cdlgconnsettingsmulticast.ui -# src/cdlgnewconnection.ui -# src/cdlglevel1filter.ui -# src/cdlglevel1filterwizard.ui -# src/cdlglevel2filter.ui -# src/cdlgsocketcanflags.ui -# src/cdlgmqttpublish.ui -# src/cdlgmqttsubscribe.ui -# src/cdlgknownguid.ui -# src/cdlgeditguid.ui -# src/cdlgcanfilter.ui -# src/cdlgtls.ui -# src/cdlglog.ui -# src/cdlgsensorindex.ui -# src/cdlgeditsensorindex.ui -# src/cdlgtxedit.ui -# src/cdlgsessionfilter.ui -# src/cdlgeditsessionfilter.ui -# src/cdlgselectclass.ui -# src/cdlgselectguid.ui -# src/cdlgselectobid.ui -# src/cdlgselectdata.ui -# src/cdlgselectdatasize.ui -# src/cdlgselectmeasurementvalue.ui -# src/cdlgselectpriority.ui -# src/cdlgselectmeasurementvalue.ui -# src/cdlgselecttimestamp.ui -# src/cdlgselectunit.ui -# src/cdlgselectsensorindex.ui -# src/cdlgselectdatacoding.ui -# src/cdlgselectdate.ui -# src/cdlgselectconstraint.ui -# src/cfrmnodeconfig.ui -# src/cfrmnodescan.ui -# src/cdlgactionparam.ui -# src/cdlgdatepicker.ui -# src/cfrmmdf.ui -# src/cdlgmdfmodule.ui -# src/cdlgmdffilepicture.ui -# src/cdlgmdfmodule.ui -# src/cdlgmdfevent.ui -# src/cdlgmdffilesetup.ui -# src/cdlgmdfregister.ui -# src/cdlgmdfbootloader.ui -# src/cdlgmdffiledriver.ui -# src/cdlgmdffile.ui -# src/cdlgmdfremotevar.ui -# src/cdlgmdfdescription.ui -# src/cdlgmdfinfourl.ui -# src/cdlgmdffilefirmware.ui -# src/cdlgmdffilevideo.ui -# src/cdlgmdffilemanual.ui -# src/cdlgmdfvaluelist.ui -# src/cdlgeditmap.ui -# src/cdlgmdfmanufacturer.ui -# src/cdlgmdfcontact.ui -# src/cdlgmdfcontactlist.ui - -# src/cdlgmdfregister.ui -# src/cdlgmdfregisterlist.ui - -# src/cdlgmdfbit.ui -# src/cdlgmdfbitlist.ui -# src/cdlgmdfvalue.ui -# src/cdlgmdfvaluelist.ui - -# src/cdlgmdfregistermapping.ui - -# src/cdlgmdfremotevar.ui -# src/cdlgmdfremotevarlist.ui - -# src/cdlgmdfdm.ui -# src/cdlgmdfdmaction.ui -# str/cdlgmdfdmactionparam.ui - -# src/cdlgmdfevents.ui -# src/cdlgmdfeventdata.ui - -# src/cdlgtxtsearch.ui - -# src/cdlgselectmqtttopics.ui - -# src/cdlgbootfirmware.ui - -# src/cdlgselectbootalgorithm.ui -#) qt_add_executable(${PROJECT_NAME} src/vscpworks.qrc @@ -715,11 +616,6 @@ if (MSVC) ./third_party/maddy/include/ ./third_party/crypto-algorithms/ ${PThreads4W_INCLUDE_DIR} - ${Qt5Widgets_INCLUDE_DIRS} - ${Qt5Core_INCLUDE_DIRS} - ${Qt5SerialBus_INCLUDE_DIRS} - ${Qt5SerialPort_INCLUDE_DIRS} - ${Qt5Network_INCLUDE_DIRS} ${CMAKE_BINARY_DIR} ${OPENSSL_INCLUDE_DIR} ${MOSQUITTO_INCLUDE_DIRS} @@ -744,10 +640,6 @@ else() ./third_party/mustache/ ./third_party/maddy/include/ ./third_party/crypto-algorithms/s - ${Qt5Core_INCLUDE_DIRS} - ${Qt5SerialBus_INCLUDE_DIRS} - ${Qt5SerialPort_INCLUDE_DIRS} - ${Qt5Network_INCLUDE_DIRS} ${CMAKE_BINARY_DIR} ${OPENSSL_INCLUDE_DIR} ${MOSQUITTO_INCLUDE_DIRS} @@ -765,26 +657,16 @@ if (MSVC) message(STATUS "Mosquitto lib: ${MOSQUITTO_LIB_DIR} --- ${VCPKG_ROOT}/installed/x64-windows/lib/mosquitto.lib") link_directories(${MOSQUITTO_LIB_DIR}) - #find_path(LIBWEBSOCKETS_LIBRARY_DIR ${LIBWEBSOCKETS_LIBRARIES} HINTS "${VCPKG_ROOT}/installed/x64-windows/lib") - #find_path(LIBWEBSOCKETS_LIBRARY_DIR libwebsockets.lib websockets.lib websockets_shared.lib HINTS "${VCPKG_ROOT}/installed/x64-windows/lib") message(STATUS "lib websockets lib: ${LIBWEBSOCKETS_LIBRARY_DIR} --- ${VCPKG_ROOT}/installed/x64-windows/lib/${LIBWEBSOCKETS_LIBRARIES}") link_directories(${LIBWEBSOCKETS_LIBRARY_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE - Qt5::Widgets - Qt5::Core - Qt5::Network - Qt5::Quick - Qt5::Sql - Qt5::Charts PThreads4W::PThreads4W OpenSSL::SSL OpenSSL::Crypto OpenSSL::SSL OpenSSL::Crypto - # eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs ${MOSQUITTO_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} - #"${VCPKG_ROOT}/installed/x64-windows/lib/mosquitto.lib" expat::expat CURL::libcurl dlfcn-win32::dl @@ -795,12 +677,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Qml Qt6::Sql Qt6::Charts -# ${Qt5Widgets_LIBRARIES} -# ${Qt5Core_LIBRARIES} -# Qt5::Network -# Qt5::Quick -# Qt5::Sql -# Qt5::Charts m dl Threads::Threads @@ -815,16 +691,12 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ) endif() -# https://www3.sra.co.jp/qt/relation/doc/qtdoc/cmake-manual.html -#qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) -#qt5_add_resources(src/vscpworks.qrc qdarkstyle/theme/style.qrc) - if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-DWIN32_LEAN_AND_MEANS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) - set(LIBS_SYSTEM ws2_32) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-DWIN32_LEAN_AND_MEANS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + set(LIBS_SYSTEM ws2_32) elseif(UNIX) set(LIBS_SYSTEM c stdc++) endif() diff --git a/src/cdlgconnsettingssocketcan.cpp b/src/cdlgconnsettingssocketcan.cpp index 2e6b8d35..aeeb53ec 100644 --- a/src/cdlgconnsettingssocketcan.cpp +++ b/src/cdlgconnsettingssocketcan.cpp @@ -522,21 +522,18 @@ void CDlgConnSettingsSocketCan::onTestConnection(void) QString errorstr = tr("Failed to connect to interface. [%1] rv=%2").arg(getDevice().arg(rv)); QMessageBox::question(this, tr(APPNAME), - errorstr.arg(rv), - QMessageBox::Ok); + errorstr.arg(rv)); } else { QMessageBox::question(this, tr(APPNAME), - tr("Successful connect"), - QMessageBox::Ok); + tr("Successful connect")); } if (VSCP_ERROR_SUCCESS != (rv = m_clientSocketcan.disconnect())) { QMessageBox::question(this, tr(APPNAME), - tr("Failed to disconnect from interface."), - QMessageBox::Ok); + tr("Failed to disconnect from interface.")); } } diff --git a/src/cfrmnodeconfig.cpp b/src/cfrmnodeconfig.cpp index 2bc0841a..0d3535c8 100644 --- a/src/cfrmnodeconfig.cpp +++ b/src/cfrmnodeconfig.cpp @@ -690,13 +690,13 @@ CFrmNodeConfig::CFrmNodeConfig(QWidget* parent, QJsonObject* pconn) // Edit selected DM row QAction* actEditDM = new QAction(tr("Edit DM row"), this); - actEditDM->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E)); + actEditDM->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_E)); connect(actEditDM, &QAction::triggered, this, &CFrmNodeConfig::editDMRow); ui->treeWidgetDecisionMatrix->addAction(actEditDM); // Toggle active state for selected DM row QAction* actToggleDM = new QAction(tr("Toggle active state for DM row"), this); - actToggleDM->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T)); + actToggleDM->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_T)); connect(actToggleDM, &QAction::triggered, this, &CFrmNodeConfig::toggleDMRow); ui->treeWidgetDecisionMatrix->addAction(actToggleDM); diff --git a/src/cfrmsession.cpp b/src/cfrmsession.cpp index f1a17013..05440b4b 100644 --- a/src/cfrmsession.cpp +++ b/src/cfrmsession.cpp @@ -490,25 +490,25 @@ CFrmSession::createMenu() m_toggleRxClassMarkAct = m_editMenu->addAction(tr("Toggle RX Class mark"), this, &CFrmSession::setVscpClassMark); - m_toggleRxClassMarkAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_C)); + m_toggleRxClassMarkAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_C)); m_toggleRxClassMarkAct->setStatusTip(tr("Mark the receive row with special background color")); m_toggleRxTypeMarkAct = m_editMenu->addAction(tr("Toggle RX Type mark"), this, &CFrmSession::setVscpTypeMark); - m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_T)); + m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_T)); m_toggleRxTypeMarkAct->setStatusTip(tr("Mark the receive row with special background color")); m_addExCommentAct = m_editMenu->addAction(tr("Add/Edit RX comment"), this, &CFrmSession::addEventNote); - m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_T)); + m_toggleRxTypeMarkAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_T)); m_toggleRxTypeMarkAct->setStatusTip(tr("Add a comment to selected RX row(s)")); m_deleteRxCommentAct = m_editMenu->addAction(tr("Remove RX comment"), this, &CFrmSession::removeEventNote); - m_deleteRxCommentAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_T)); + m_deleteRxCommentAct->setShortcut(QKeySequence(Qt::ALT | Qt::Key_T)); m_deleteRxCommentAct->setStatusTip(tr("Remove a comment from selected RX row(s)")); m_menuBar->addMenu(m_editMenu); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4304f761..77b13501 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2450,9 +2450,7 @@ MainWindow::newNodeConfiguration() int ret = QMessageBox::warning(this, tr("VSVP Works+"), tr("No connection selected.\n" - "Please select a connection first."), - QMessageBox::Ok, - QMessageBox::Information); + "Please select a connection first.")); return; } @@ -2496,9 +2494,7 @@ MainWindow::newNodeScan() int ret = QMessageBox::warning(this, tr("VSVP Works+"), tr("No connection selected.\n" - "Please select a connection first."), - QMessageBox::Ok, - QMessageBox::Information); + "Please select a connection first.")); return; } @@ -2543,9 +2539,7 @@ MainWindow::newNodeBootload() int ret = QMessageBox::warning(this, tr("VSVP Works+"), tr("No connection selected.\n" - "Please select a connection first."), - QMessageBox::Ok, - QMessageBox::Information); + "Please select a connection first.")); return; }