From d07214ab9235388780920f2bfafda5550b4f00e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 19:20:52 +0200 Subject: [PATCH 01/36] Migrated from Qt5(Kf5 to Qt6/Kf6 in cmake-files --- CMakeLists.txt | 8 +++---- cmake/define_definitions.cmake | 4 ++-- cmake/developer_options.cmake | 4 ++-- cmake/fetch_kdeaddons.cmake | 39 +++++++++++++-------------------- tests/catch/CMakeLists.txt | 3 +-- tests/googlemock/CMakeLists.txt | 3 +-- tests/googletest/CMakeLists.txt | 3 +-- tests/qttest/CMakeLists.txt | 3 +-- 8 files changed, 27 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 794ac6eb5..1b3545c67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,6 @@ find_package( QT NAMES Qt6 - Qt5 COMPONENTS ${QET_COMPONENTS} REQUIRED @@ -71,9 +70,10 @@ find_package( REQUIRED) set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui) -qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) + +qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang") -qt5_add_translation(QM_FILES ${TS_FILES}) +qt_add_translation(QM_FILES ${TS_FILES}) # als laatse include(cmake/define_definitions.cmake) @@ -92,7 +92,7 @@ target_link_libraries( PRIVATE pugixml::pugixml SingleApplication::SingleApplication - ${KF5_PRIVATE_LIBRARIES} + ${KF6_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES} ) diff --git a/cmake/define_definitions.cmake b/cmake/define_definitions.cmake index 7f9cb6ae0..94550bbde 100644 --- a/cmake/define_definitions.cmake +++ b/cmake/define_definitions.cmake @@ -62,8 +62,8 @@ message("PROJECT_SOURCE_DIR :" ${PROJECT_SOURCE_DIR}) message("QET_DIR :" ${QET_DIR}) message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA}) -if(BUILD_WITH_KF5) - message("KF5_GIT_TAG :" ${KF5_GIT_TAG}) +if(BUILD_WITH_KF6) + message("KF6_GIT_TAG :" ${KF6_GIT_TAG}) else() add_definitions(-DBUILD_WITHOUT_KF5) endif() diff --git a/cmake/developer_options.cmake b/cmake/developer_options.cmake index 04f002da4..677c61f93 100644 --- a/cmake/developer_options.cmake +++ b/cmake/developer_options.cmake @@ -31,5 +31,5 @@ add_definitions(-DQT_MESSAGELOGCONTEXT) # In order to do so, uncomment the following line. #add_definitions(-DTODO_LIST) -# Build with KF5 -option(BUILD_WITH_KF5 "Build with KF5" ON) +# Build with KF6 +option(BUILD_WITH_KF6 "Build with KF6" ON) diff --git a/cmake/fetch_kdeaddons.cmake b/cmake/fetch_kdeaddons.cmake index ac5a340f9..6ea692f8f 100644 --- a/cmake/fetch_kdeaddons.cmake +++ b/cmake/fetch_kdeaddons.cmake @@ -16,52 +16,43 @@ message(" - fetch_kdeaddons") -if(DEFINED BUILD_WITH_KF5) +if(DEFINED BUILD_WITH_KF6) Include(FetchContent) - option(BUILD_KF5 "Build KF5 libraries, use system ones otherwise" YES) + option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" NO) - if(BUILD_KF5) + if(BUILD_KF6) - if(NOT DEFINED KF5_GIT_TAG) - #https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924 - set(KF5_GIT_TAG v5.77.0) + if(NOT DEFINED KF6_GIT_TAG) + set(KF6_GIT_TAG v6.5.0) endif() - # Fix stop the run autotests of kcoreaddons - # see - # https://invent.kde.org/frameworks/kcoreaddons/-/blob/master/CMakeLists.txt#L98 - # issue: - # CMake Error at /usr/share/ECM/modules/ECMAddTests.cmake:89 (add_executable): - # Cannot find source file: - # see - # https://qelectrotech.org/forum/viewtopic.php?pid=13929#p13929 - set(KDE_SKIP_TEST_SETTINGS "TRUE") - set(BUILD_TESTING "0") + # + set(BUILD_TESTING OFF) FetchContent_Declare( ecm GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git - GIT_TAG ${KF5_GIT_TAG}) + GIT_TAG ${KF6_GIT_TAG}) FetchContent_MakeAvailable(ecm) FetchContent_Declare( kcoreaddons GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git - GIT_TAG ${KF5_GIT_TAG}) + GIT_TAG ${KF6_GIT_TAG}) FetchContent_MakeAvailable(kcoreaddons) FetchContent_Declare( kwidgetsaddons GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git - GIT_TAG ${KF5_GIT_TAG}) + GIT_TAG ${KF6_GIT_TAG}) FetchContent_MakeAvailable(kwidgetsaddons) else() - find_package(KF5CoreAddons REQUIRED) - find_package(KF5WidgetsAddons REQUIRED) + find_package(KF6CoreAddons REQUIRED) + find_package(KF6WidgetsAddons REQUIRED) endif() - set(KF5_PRIVATE_LIBRARIES - KF5::WidgetsAddons - KF5::CoreAddons + set(KF6_PRIVATE_LIBRARIES + KF6::WidgetsAddons + KF6::CoreAddons ) endif() diff --git a/tests/catch/CMakeLists.txt b/tests/catch/CMakeLists.txt index b6ab66bf0..b2d0cc2d1 100644 --- a/tests/catch/CMakeLists.txt +++ b/tests/catch/CMakeLists.txt @@ -45,7 +45,6 @@ if(NOT DEFINED QT_VERSION_MAJOR) QT NAMES Qt6 - Qt5 COMPONENTS ${QET_COMPONENTS} REQUIRED @@ -88,7 +87,7 @@ target_link_libraries( PUBLIC Catch2::Catch2 PRIVATE - ${KF5_PRIVATE_LIBRARIES} + ${KF6_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES}) if (DEFINED ENV{CATCH_INCLUDE_DIR}) diff --git a/tests/googlemock/CMakeLists.txt b/tests/googlemock/CMakeLists.txt index db29ef8c9..c364fee37 100644 --- a/tests/googlemock/CMakeLists.txt +++ b/tests/googlemock/CMakeLists.txt @@ -45,7 +45,6 @@ if(NOT DEFINED QT_VERSION_MAJOR) QT NAMES Qt6 - Qt5 COMPONENTS ${QET_COMPONENTS} REQUIRED @@ -85,6 +84,6 @@ target_link_libraries( PUBLIC gmock gmock_main PRIVATE - ${KF5_PRIVATE_LIBRARIES} + ${KF6_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES}) diff --git a/tests/googletest/CMakeLists.txt b/tests/googletest/CMakeLists.txt index d9a4ae750..cd7a8beab 100644 --- a/tests/googletest/CMakeLists.txt +++ b/tests/googletest/CMakeLists.txt @@ -45,7 +45,6 @@ if(NOT DEFINED QT_VERSION_MAJOR) QT NAMES Qt6 - Qt5 COMPONENTS ${QET_COMPONENTS} REQUIRED @@ -84,6 +83,6 @@ target_link_libraries( PUBLIC gtest gtest_main PRIVATE - ${KF5_PRIVATE_LIBRARIES} + ${KF6_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES}) diff --git a/tests/qttest/CMakeLists.txt b/tests/qttest/CMakeLists.txt index 41137a3e5..88e8981ea 100644 --- a/tests/qttest/CMakeLists.txt +++ b/tests/qttest/CMakeLists.txt @@ -45,7 +45,6 @@ if(NOT DEFINED QT_VERSION_MAJOR) QT NAMES Qt6 - Qt5 COMPONENTS ${QET_COMPONENTS} Test @@ -74,6 +73,6 @@ target_link_libraries( ${PROJECT_NAME} PRIVATE Qt::Test - ${KF5_PRIVATE_LIBRARIES} + ${KF6_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES}) From 540a248d72b8ca741846dcd5791ee9ec913091cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 19:26:24 +0200 Subject: [PATCH 02/36] Bumped git-versions in cmake for pugixml and singleapplication --- cmake/fetch_pugixml.cmake | 2 +- cmake/fetch_singleapplication.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/fetch_pugixml.cmake b/cmake/fetch_pugixml.cmake index 88ac3cf7b..56a82377e 100644 --- a/cmake/fetch_pugixml.cmake +++ b/cmake/fetch_pugixml.cmake @@ -25,7 +25,7 @@ if(BUILD_PUGIXML) FetchContent_Declare( pugixml GIT_REPOSITORY https://github.com/zeux/pugixml.git - GIT_TAG v1.11.4) + GIT_TAG v1.14) FetchContent_MakeAvailable(pugixml) else() diff --git a/cmake/fetch_singleapplication.cmake b/cmake/fetch_singleapplication.cmake index c01cc408c..30827677a 100644 --- a/cmake/fetch_singleapplication.cmake +++ b/cmake/fetch_singleapplication.cmake @@ -26,6 +26,6 @@ Include(FetchContent) FetchContent_Declare( SingleApplication GIT_REPOSITORY https://github.com/itay-grudev/SingleApplication.git - GIT_TAG v3.2.0) + GIT_TAG v3.5.1) FetchContent_MakeAvailable(SingleApplication) From bae85624a03751d95109cac01b6f751a6ed025a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 19:42:45 +0200 Subject: [PATCH 03/36] Bumped git-versions in cmake for catch and googletest --- tests/catch/CMakeLists.txt | 2 +- tests/googlemock/CMakeLists.txt | 2 +- tests/googletest/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/catch/CMakeLists.txt b/tests/catch/CMakeLists.txt index b2d0cc2d1..385aadec5 100644 --- a/tests/catch/CMakeLists.txt +++ b/tests/catch/CMakeLists.txt @@ -63,7 +63,7 @@ Include(FetchContent) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v2.13.1) + GIT_TAG v3.7.0) FetchContent_MakeAvailable(Catch2) diff --git a/tests/googlemock/CMakeLists.txt b/tests/googlemock/CMakeLists.txt index c364fee37..3fe7b24e5 100644 --- a/tests/googlemock/CMakeLists.txt +++ b/tests/googlemock/CMakeLists.txt @@ -63,7 +63,7 @@ Include(FetchContent) FetchContent_Declare( GTest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.10.0) + GIT_TAG v1.15.2) FetchContent_MakeAvailable(GTest) diff --git a/tests/googletest/CMakeLists.txt b/tests/googletest/CMakeLists.txt index cd7a8beab..240251800 100644 --- a/tests/googletest/CMakeLists.txt +++ b/tests/googletest/CMakeLists.txt @@ -63,7 +63,7 @@ Include(FetchContent) FetchContent_Declare( GTest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.10.0) + GIT_TAG v1.15.2) FetchContent_MakeAvailable(GTest) From 8a4d7c6cf20cf37bbe94b53fd2338c611b10a606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 19:44:14 +0200 Subject: [PATCH 04/36] Fixed compiler warning for overloaded qHash() --- sources/TerminalStrip/ui/terminalstripmodel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/TerminalStrip/ui/terminalstripmodel.h b/sources/TerminalStrip/ui/terminalstripmodel.h index a541165a2..24b5aa0f5 100644 --- a/sources/TerminalStrip/ui/terminalstripmodel.h +++ b/sources/TerminalStrip/ui/terminalstripmodel.h @@ -30,7 +30,7 @@ //Code to use QColor as key for QHash inline uint qHash(const QColor &key, uint seed) { - return qHash(key.name(), seed); + return qHash((QString)key.name(), (size_t)seed); } //needed to use QPointer as key of QHash From d3f206a387df00a86f0819cac522401f4dd28dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 20:07:02 +0200 Subject: [PATCH 05/36] Removed obsolete QGIManager::manage/release(QVector) --- sources/qgimanager.cpp | 12 ------------ sources/qgimanager.h | 8 ++------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/sources/qgimanager.cpp b/sources/qgimanager.cpp index aeb73c600..03b01b1a2 100644 --- a/sources/qgimanager.cpp +++ b/sources/qgimanager.cpp @@ -89,18 +89,6 @@ void QGIManager::release(const QList &qgis) { foreach(QGraphicsItem *qgi, qgis) release(qgi); } -void QGIManager::manage(const QVector &items) { - for (const auto &qgi : items) { - manage(qgi); - } -} - -void QGIManager::release(const QVector &items) { - for (const auto &qgi : items) { - release(qgi); - } -} - /** Indique au QGIManager de detruire les QGraphicsItem restants lors de sa destruction si ceux-ci n'appartiennent pas a la scene diff --git a/sources/qgimanager.h b/sources/qgimanager.h index c4ffc61c0..4db036650 100644 --- a/sources/qgimanager.h +++ b/sources/qgimanager.h @@ -45,12 +45,8 @@ class QGIManager { public: void manage(QGraphicsItem *); void release(QGraphicsItem *); - QT_DEPRECATED_X("Use QGIManager::manage(const QVector &) instead") - void manage(const QList &); - QT_DEPRECATED_X("Use QGIManager::release(const QVector &) instead") - void release(const QList &); - void manage(const QVector &items); - void release(const QVector &items); + void manage(const QList &); + void release(const QList &); void setDestroyQGIOnDelete(bool); bool manages(QGraphicsItem *) const; }; From 9127937bee319df646eca71dfef3286ca110e45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 20:16:07 +0200 Subject: [PATCH 06/36] Added bool cast fixing compiler crash --- sources/titleblocktemplate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/titleblocktemplate.cpp b/sources/titleblocktemplate.cpp index b889e1e49..6b8f552f3 100644 --- a/sources/titleblocktemplate.cpp +++ b/sources/titleblocktemplate.cpp @@ -103,7 +103,7 @@ bool TitleBlockTemplate::loadFromXmlFile(const QString &filepath) { // parse its content as XML QDomDocument xml_doc; - bool xml_parsing = xml_doc.setContent(&template_file); + bool xml_parsing = (bool)xml_doc.setContent(&template_file); if (!xml_parsing) { return(false); } From 0b307abf34642afc00e6a3d12514b89a1f154fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 20:47:06 +0200 Subject: [PATCH 07/36] Corrected overloaded qHash() from earlier commit 21fcf688ec3b8b82e89d1be5424b0aa4d356e1ab --- sources/TerminalStrip/ui/terminalstripmodel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/TerminalStrip/ui/terminalstripmodel.h b/sources/TerminalStrip/ui/terminalstripmodel.h index 24b5aa0f5..9c07ac963 100644 --- a/sources/TerminalStrip/ui/terminalstripmodel.h +++ b/sources/TerminalStrip/ui/terminalstripmodel.h @@ -29,12 +29,12 @@ #include "modelTerminalData.h" //Code to use QColor as key for QHash -inline uint qHash(const QColor &key, uint seed) { - return qHash((QString)key.name(), (size_t)seed); +inline size_t qHash(const QColor &key, size_t seed) { + return qHash(key.name(), seed); } //needed to use QPointer as key of QHash -inline uint qHash(const QPointer &key, uint seed) { +inline size_t qHash(const QPointer &key, size_t seed) { if (key) return qHash(key->uuid(), seed); else From 0dc45f056e4a37f8e62f0c94d14bb2af20529142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 21:10:13 +0200 Subject: [PATCH 08/36] Fixed deprecated regex exactMatch() --- sources/ElementsCollection/elementslocation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index f9c66c369..28b6fb52c 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -805,15 +805,15 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const qDebug() << "Help code for QT 6 or later"; QString path_ = collectionPath(false); - QRegularExpression rx("^(.*)/(.*\\.elmt)$"); - - if (rx.exactMatch(path_)) + QRegularExpression rx(QRegularExpression::anchoredPattern("(.*)/(.*\\.elmt)")); + QRegularExpressionMatch match = rx.match(path_); + if (match.hasMatch()) { return project() ->embeddedElementCollection() ->addElementDefinition( - rx.cap(1), - rx.cap(2), + match.captured(1), + match.captured(2), xml_document.documentElement()); } else From 6c5ff66067144e0925b4c887f7b45ed912a01f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 21:14:28 +0200 Subject: [PATCH 09/36] Include correct header file for catch --- tests/catch/main.cpp | 2 +- tests/catch/src/borderproperties_test.cpp | 2 +- tests/catch/src/qet_test.cpp | 2 +- tests/catch/tst_My_test.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/catch/main.cpp b/tests/catch/main.cpp index d21ec02b2..cc6491f38 100644 --- a/tests/catch/main.cpp +++ b/tests/catch/main.cpp @@ -1,6 +1,6 @@ #define CATCH_CONFIG_RUNNER #include -#include +#include int main(int argc, char** argv) { diff --git a/tests/catch/src/borderproperties_test.cpp b/tests/catch/src/borderproperties_test.cpp index 7492b4f77..1050611a7 100644 --- a/tests/catch/src/borderproperties_test.cpp +++ b/tests/catch/src/borderproperties_test.cpp @@ -1,6 +1,6 @@ #include "../../../sources/borderproperties.h" -#include +#include TEST_CASE("BorderProperties") { diff --git a/tests/catch/src/qet_test.cpp b/tests/catch/src/qet_test.cpp index 09753bbe0..d62620306 100644 --- a/tests/catch/src/qet_test.cpp +++ b/tests/catch/src/qet_test.cpp @@ -1,6 +1,6 @@ #include "../../../sources/qet.h" -#include +#include TEST_CASE("qet stringToFileName") { diff --git a/tests/catch/tst_My_test.cpp b/tests/catch/tst_My_test.cpp index 2f75acacc..d3730b27f 100644 --- a/tests/catch/tst_My_test.cpp +++ b/tests/catch/tst_My_test.cpp @@ -1,3 +1,3 @@ -#include +#include TEST_CASE("My first test with Catch2", "[fancy]") { REQUIRE(0 == 0); } From dd521f13aa731e224a062aacf4a6bb013c346bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 21:24:22 +0200 Subject: [PATCH 10/36] Added missing includes --- sources/titleblock/templateview.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/titleblock/templateview.h b/sources/titleblock/templateview.h index 67a816459..d670a0be1 100644 --- a/sources/titleblock/templateview.h +++ b/sources/titleblock/templateview.h @@ -19,6 +19,8 @@ #define TITLEBLOCK_SLASH_TEMPLATE_VIEW_H #include "../titleblocktemplate.h" +#include +#include #include class HelperCell; class SplittedHelperCell; From 8ba96ac6e26980786fc99104533fd5efce86e5be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 21:29:53 +0200 Subject: [PATCH 11/36] Added bool cast fixing compile error --- sources/titleblock/templatescollection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/titleblock/templatescollection.cpp b/sources/titleblock/templatescollection.cpp index b2b0ae40c..40ee0da87 100644 --- a/sources/titleblock/templatescollection.cpp +++ b/sources/titleblock/templatescollection.cpp @@ -454,7 +454,7 @@ QDomElement TitleBlockTemplatesFilesCollection::getTemplateXmlDescription(const } QDomDocument *xml_document = new QDomDocument(); - bool xml_parsing = xml_document -> setContent(&xml_file); + bool xml_parsing = (bool)xml_document -> setContent(&xml_file); if (!xml_parsing) { delete xml_document; return(QDomElement()); From cfdad56d0e325dbd2162c61b3fccca1fce9a5ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 21:40:14 +0200 Subject: [PATCH 12/36] Added qsizetype cast fixing compile error --- sources/TerminalStrip/physicalterminal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/TerminalStrip/physicalterminal.cpp b/sources/TerminalStrip/physicalterminal.cpp index f9c06de3e..4a3a91866 100644 --- a/sources/TerminalStrip/physicalterminal.cpp +++ b/sources/TerminalStrip/physicalterminal.cpp @@ -131,7 +131,7 @@ bool PhysicalTerminal::setLevelOf(const QSharedPointer &terminal, if (i >= 0) { #if QT_VERSION >= QT_VERSION_CHECK(5,14,0) - m_real_terminal.swapItemsAt(i, std::min(level, m_real_terminal.size()-1)); + m_real_terminal.swapItemsAt(i, std::min((qsizetype)level, m_real_terminal.size()-1)); #else auto j = std::min(level, m_real_terminal.size()-1); std::swap(m_real_terminal.begin()[i], m_real_terminal.begin()[j]); From 4fe9687acae7584a665b16949b8b9080630d82c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 21:48:31 +0200 Subject: [PATCH 13/36] Added missing include --- sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp index 16c2b5146..1a82a6587 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp +++ b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp @@ -17,6 +17,7 @@ */ #include "terminalstripdrawer.h" #include +#include namespace TerminalStripDrawer { From 27899c48a349f2ad4690a27e4de428a9c0925d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 22:46:01 +0200 Subject: [PATCH 14/36] Fixed crash with db export disabled --- sources/qetdiagrameditor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h index 5bd7b280a..382605fa6 100644 --- a/sources/qetdiagrameditor.h +++ b/sources/qetdiagrameditor.h @@ -195,7 +195,9 @@ class QETDiagramEditor : public QETMainWindow *m_terminal_strip_dialog = nullptr, /// Date: Sun, 8 Sep 2024 23:13:32 +0200 Subject: [PATCH 15/36] Fixed export project db (added SQLite3 in cmake) --- CMakeLists.txt | 3 +++ cmake/start_options.cmake | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b3545c67..f98be661d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,12 +86,15 @@ add_executable( ${QET_DIR}/qelectrotech.qrc ) +find_package(SQLite3 REQUIRED) + target_link_libraries( ${PROJECT_NAME} PUBLIC PRIVATE pugixml::pugixml SingleApplication::SingleApplication + SQLite::SQLite3 ${KF6_PRIVATE_LIBRARIES} ${QET_PRIVATE_LIBRARIES} ) diff --git a/cmake/start_options.cmake b/cmake/start_options.cmake index f3494cfd9..b251651bf 100644 --- a/cmake/start_options.cmake +++ b/cmake/start_options.cmake @@ -29,4 +29,4 @@ add_definitions(-DQET_ALLOW_OVERRIDE_CD_OPTION) add_definitions(-DQET_ALLOW_OVERRIDE_DD_OPTION) #comment the line below to disable the project database export -#add_definitions(-DQET_EXPORT_PROJECT_DB) #error Todo +add_definitions(-DQET_EXPORT_PROJECT_DB) From a88d4850516c550563fc1c04d96a4d2f056fc567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 23:15:38 +0200 Subject: [PATCH 16/36] Replaced BUILD_WITHOUT_KF5 to BUILD_WITHOUT_KF6 --- cmake/define_definitions.cmake | 2 +- sources/editor/ui/dynamictextfieldeditor.cpp | 4 ++-- sources/editor/ui/dynamictextfieldeditor.h | 4 ++-- sources/editor/ui/texteditor.cpp | 4 ++-- sources/editor/ui/texteditor.h | 4 ++-- sources/qetapp.cpp | 4 ++-- sources/qetdiagrameditor.cpp | 4 ++-- sources/qetdiagrameditor.h | 4 ++-- sources/qetproject.cpp | 6 +++--- sources/qetproject.h | 8 ++++---- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmake/define_definitions.cmake b/cmake/define_definitions.cmake index 94550bbde..75b65ae38 100644 --- a/cmake/define_definitions.cmake +++ b/cmake/define_definitions.cmake @@ -65,7 +65,7 @@ message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA}) if(BUILD_WITH_KF6) message("KF6_GIT_TAG :" ${KF6_GIT_TAG}) else() - add_definitions(-DBUILD_WITHOUT_KF5) + add_definitions(-DBUILD_WITHOUT_KF6) endif() message("QET_COMPONENTS :" ${QET_COMPONENTS}) message("QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR}) diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index b21c2039d..afb841bb9 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -140,7 +140,7 @@ void DynamicTextFieldEditor::updateForm() ui -> m_user_text_le -> setText(m_text_field.data() -> text()); ui -> m_size_sb -> setValue(m_text_field.data() -> font().pointSize()); ui->m_keep_visual_rotation_cb->setChecked(m_text_field.data()->keepVisualRotation()); -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else m_color_kpb -> setColor(m_text_field.data() -> color()); #endif @@ -169,7 +169,7 @@ void DynamicTextFieldEditor::updateForm() void DynamicTextFieldEditor::setupWidget() { -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else m_color_kpb = new KColorButton(this); m_color_kpb->setObjectName(QString::fromUtf8("m_color_kpb")); diff --git a/sources/editor/ui/dynamictextfieldeditor.h b/sources/editor/ui/dynamictextfieldeditor.h index d419f9c72..29644c4ae 100644 --- a/sources/editor/ui/dynamictextfieldeditor.h +++ b/sources/editor/ui/dynamictextfieldeditor.h @@ -21,7 +21,7 @@ #include "../elementitemeditor.h" #include "../graphicspart/partdynamictextfield.h" -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else # include #endif @@ -77,7 +77,7 @@ class DynamicTextFieldEditor : public ElementItemEditor { QList m_parts; QList m_connection_list; - #ifdef BUILD_WITHOUT_KF5 + #ifdef BUILD_WITHOUT_KF6 #else KColorButton* m_color_kpb = nullptr; #endif diff --git a/sources/editor/ui/texteditor.cpp b/sources/editor/ui/texteditor.cpp index b088e6571..4dea81414 100644 --- a/sources/editor/ui/texteditor.cpp +++ b/sources/editor/ui/texteditor.cpp @@ -62,7 +62,7 @@ void TextEditor::updateForm() m_rotation_sb -> setValue(m_text -> rotation()); m_size_sb -> setValue(m_text -> font().pointSize()); m_font_pb -> setText(m_text -> font().family()); -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else m_color_pb -> setColor(m_text -> defaultTextColor()); #endif @@ -344,7 +344,7 @@ void TextEditor::setUpWidget(QWidget *parent) m_line_edit->setPlaceholderText(tr("Entrer votre texte ici")); gridLayout->addWidget(m_line_edit, 0, 0, 1, 6); -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else m_color_pb = new KColorButton(parent); m_color_pb->setObjectName(QString::fromUtf8("m_color_pb")); diff --git a/sources/editor/ui/texteditor.h b/sources/editor/ui/texteditor.h index 97d85d4d5..de6bc8b74 100644 --- a/sources/editor/ui/texteditor.h +++ b/sources/editor/ui/texteditor.h @@ -25,7 +25,7 @@ #include #include #include -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else #include #endif @@ -65,7 +65,7 @@ class TextEditor : public ElementItemEditor { QSpinBox *m_size_sb; QLineEdit *m_line_edit; QPushButton *m_font_pb; -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else KColorButton *m_color_pb; #endif diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 8967347ae..727dbdc89 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -45,7 +45,7 @@ #define STRINGIFY(x) #x #include #include -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else # include #endif @@ -2368,7 +2368,7 @@ void QETApp::buildSystemTrayMenu() */ void QETApp::checkBackupFiles() { -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 return; #else QList stale_files = KAutoSaveFile::allStaleFiles(); diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index e50b158e4..96ca61871 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -46,7 +46,7 @@ #include "ui/diagrameditorhandlersizewidget.h" #include "TerminalStrip/ui/addterminalstripitemdialog.h" -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else # include #endif @@ -1892,7 +1892,7 @@ bool QETDiagramEditor::drawGrid() const return m_draw_grid->isChecked(); } -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else /** @brief QETDiagramEditor::openBackupFiles diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h index 382605fa6..db528ca31 100644 --- a/sources/qetdiagrameditor.h +++ b/sources/qetdiagrameditor.h @@ -43,7 +43,7 @@ class DiagramPropertiesEditorDockWidget; class ElementsCollectionWidget; class AutoNumberingDockWidget; -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else class KAutoSaveFile; #endif @@ -69,7 +69,7 @@ class QETDiagramEditor : public QETMainWindow ProjectView *currentProjectView() const; QETProject *currentProject() const; bool drawGrid() const; -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else void openBackupFiles (QList backup_files); #endif diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index 4d60aba14..63f51acc4 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -86,7 +86,7 @@ QETProject::QETProject(const QString &path, QObject *parent) : init(); } -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else /** @brief QETProject::QETProject @@ -330,7 +330,7 @@ void QETProject::setFilePath(const QString &filepath) if (filepath == m_file_path) { return; } -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else if (m_backup_file.isOpen()) { m_backup_file.close(); @@ -1911,7 +1911,7 @@ NamesList QETProject::namesListForIntegrationCategory() */ void QETProject::writeBackup() { -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else # if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove QDomDocument xml_project(toXml()); diff --git a/sources/qetproject.h b/sources/qetproject.h index 696a28a44..b508a1c9b 100644 --- a/sources/qetproject.h +++ b/sources/qetproject.h @@ -29,7 +29,7 @@ #include "titleblock/templatescollection.h" #include "titleblockproperties.h" -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else # include #endif @@ -47,7 +47,7 @@ class XmlElementCollection; class QTimer; class TerminalStrip; -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else class KAutoSaveFile; #endif @@ -78,7 +78,7 @@ class QETProject : public QObject public: QETProject (QObject *parent = nullptr); QETProject (const QString &path, QObject * = nullptr); -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else QETProject (KAutoSaveFile *backup, QObject *parent=nullptr); #endif @@ -288,7 +288,7 @@ class QETProject : public QObject bool m_freeze_new_conductors = false; QTimer m_save_backup_timer, m_autosave_timer; -#ifdef BUILD_WITHOUT_KF5 +#ifdef BUILD_WITHOUT_KF6 #else KAutoSaveFile m_backup_file; #endif From 05dfd109520f2c93e599cd615774913f1e0a2d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 8 Sep 2024 23:27:02 +0200 Subject: [PATCH 17/36] Show full Qt version in cmake --- cmake/define_definitions.cmake | 2 +- tests/catch/CMakeLists.txt | 2 +- tests/googlemock/CMakeLists.txt | 2 +- tests/googletest/CMakeLists.txt | 2 +- tests/qttest/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/define_definitions.cmake b/cmake/define_definitions.cmake index 75b65ae38..03662f7ff 100644 --- a/cmake/define_definitions.cmake +++ b/cmake/define_definitions.cmake @@ -68,4 +68,4 @@ else() add_definitions(-DBUILD_WITHOUT_KF6) endif() message("QET_COMPONENTS :" ${QET_COMPONENTS}) -message("QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR}) +message("Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) diff --git a/tests/catch/CMakeLists.txt b/tests/catch/CMakeLists.txt index 385aadec5..fb94de374 100644 --- a/tests/catch/CMakeLists.txt +++ b/tests/catch/CMakeLists.txt @@ -50,13 +50,13 @@ if(NOT DEFINED QT_VERSION_MAJOR) REQUIRED ) endif() -message(".. QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR}) find_package( Qt${QT_VERSION_MAJOR} COMPONENTS ${QET_COMPONENTS} REQUIRED) + message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) Include(FetchContent) diff --git a/tests/googlemock/CMakeLists.txt b/tests/googlemock/CMakeLists.txt index 3fe7b24e5..7f5464729 100644 --- a/tests/googlemock/CMakeLists.txt +++ b/tests/googlemock/CMakeLists.txt @@ -50,13 +50,13 @@ if(NOT DEFINED QT_VERSION_MAJOR) REQUIRED ) endif() -message(".. QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR}) find_package( Qt${QT_VERSION_MAJOR} COMPONENTS ${QET_COMPONENTS} REQUIRED) +message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) Include(FetchContent) diff --git a/tests/googletest/CMakeLists.txt b/tests/googletest/CMakeLists.txt index 240251800..7192b0b06 100644 --- a/tests/googletest/CMakeLists.txt +++ b/tests/googletest/CMakeLists.txt @@ -50,13 +50,13 @@ if(NOT DEFINED QT_VERSION_MAJOR) REQUIRED ) endif() -message(".. QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR}) find_package( Qt${QT_VERSION_MAJOR} COMPONENTS ${QET_COMPONENTS} REQUIRED) + message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) Include(FetchContent) diff --git a/tests/qttest/CMakeLists.txt b/tests/qttest/CMakeLists.txt index 88e8981ea..79dec51a9 100644 --- a/tests/qttest/CMakeLists.txt +++ b/tests/qttest/CMakeLists.txt @@ -51,7 +51,6 @@ if(NOT DEFINED QT_VERSION_MAJOR) REQUIRED ) endif() -message(".. QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR}) find_package( Qt${QT_VERSION_MAJOR} @@ -59,6 +58,7 @@ find_package( ${QET_COMPONENTS} Test REQUIRED) + message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) include(../../cmake/fetch_kdeaddons.cmake) include(../../cmake/fetch_singleapplication.cmake) From 373fcfb4ea2ecc788019c526758a055a0b7bc4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 00:45:15 +0200 Subject: [PATCH 18/36] Support for loading language .qm files as Qt resource --- CMakeLists.txt | 17 +++++++++++------ cmake/define_definitions.cmake | 4 ++++ cmake/developer_options.cmake | 3 +++ sources/qetapp.cpp | 19 +++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f98be661d..e11a782a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,10 +71,6 @@ find_package( set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui) -qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) -set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang") -qt_add_translation(QM_FILES ${TS_FILES}) - # als laatse include(cmake/define_definitions.cmake) @@ -86,6 +82,14 @@ add_executable( ${QET_DIR}/qelectrotech.qrc ) +if(QMFILES_AS_RESOURCE) + qt_add_translations(${PROJECT_NAME} TS_FILES ${TS_FILES} RESOURCE_PREFIX "/lang") +else() + qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) + set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${QET_DIR}/lang") + qt_add_translation(QM_FILES ${TS_FILES}) +endif() + find_package(SQLite3 REQUIRED) target_link_libraries( @@ -152,6 +156,7 @@ install(FILES LICENSE ELEMENTS.LICENSE CREDIT README ChangeLog DESTINATION share install(FILES misc/org.qelectrotech.qelectrotech.desktop DESTINATION share/applications) install(FILES misc/qelectrotech.xml DESTINATION share/mime/packages) install(FILES misc/qelectrotech.appdata.xml DESTINATION ${QET_APPDATA_PATH}) -install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH}) - +if(NOT QMFILES_AS_RESOURCE) + install(FILES ${QM_FILES} DESTINATION ${QET_LANG_PATH}) +endif() endif() diff --git a/cmake/define_definitions.cmake b/cmake/define_definitions.cmake index 03662f7ff..c80cccef8 100644 --- a/cmake/define_definitions.cmake +++ b/cmake/define_definitions.cmake @@ -69,3 +69,7 @@ else() endif() message("QET_COMPONENTS :" ${QET_COMPONENTS}) message("Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) + +if(QMFILES_AS_RESOURCE) + add_definitions(-DQMFILES_AS_RESOURCE) +endif() \ No newline at end of file diff --git a/cmake/developer_options.cmake b/cmake/developer_options.cmake index 677c61f93..0431afd84 100644 --- a/cmake/developer_options.cmake +++ b/cmake/developer_options.cmake @@ -33,3 +33,6 @@ add_definitions(-DQT_MESSAGELOGCONTEXT) # Build with KF6 option(BUILD_WITH_KF6 "Build with KF6" ON) + +# Use translations as a Qt resource +option(QMFILES_AS_RESOURCE "Use .qm files as Qt resource" ON) diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 727dbdc89..42e352427 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -222,6 +222,23 @@ void QETApp::setLanguage(const QString &desired_language) { // load translations for the QET application // charge les traductions pour l'application QET +#ifdef QMFILES_AS_RESOURCE + if (!qetTranslator.load(QLocale(desired_language), "qet" "_", ":/lang")) { + /* in case of failure, + * we fall back on the native channels for French + * en cas d'echec, + * on retombe sur les chaines natives pour le francais + */ + if (desired_language != "fr") { + // use of the English version by default + // utilisation de la version anglaise par defaut + if(!qetTranslator.load(QLocale(desired_language), "qet", "_", ":/lang")) + qWarning() << "failed to load" + << ":/lang/qet_en.qm" << "(" << __FILE__ + << __LINE__ << __FUNCTION__ << ")"; + } + } +#else if (!qetTranslator.load("qet_" + desired_language, languages_path)) { /* in case of failure, * we fall back on the native channels for French @@ -237,6 +254,8 @@ void QETApp::setLanguage(const QString &desired_language) { << __LINE__ << __FUNCTION__ << ")"; } } +#endif + qInfo() << "Loaded language file:" << qetTranslator.filePath(); qApp->installTranslator(&qetTranslator); QString ltr_special_string = tr( From 07118d7a11bbe9f7970e65f57935bce43c5455cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 01:04:12 +0200 Subject: [PATCH 19/36] Updated deprecated QString::count() -> length() --- sources/ElementsCollection/elementscollectionwidget.cpp | 2 +- sources/bordertitleblock.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp index 2ab4e9ab3..9ed5ad635 100644 --- a/sources/ElementsCollection/elementscollectionwidget.cpp +++ b/sources/ElementsCollection/elementscollectionwidget.cpp @@ -765,7 +765,7 @@ void ElementsCollectionWidget::search() } //start the search when text have at least 3 letters. - if (text.count() < 3) { + if (text.length() < 3) { return; } diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index 7a5c42020..c3cfcc3d6 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -941,8 +941,8 @@ QString BorderTitleBlock::incrementLetters(const QString &string) { } else { // separate previous digits from last digit // separe les digits precedents du dernier digit - QString first_digits(string.left(string.count() - 1)); - QChar last_digit(string.at(string.count() - 1)); + QString first_digits(string.left(string.length() - 1)); + QChar last_digit(string.at(string.length() - 1)); if (last_digit != 'Z') { // increments the last digit // incremente le dernier digit From e8f8304b6016d0356665cdb52f02a2e81322f06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 01:13:05 +0200 Subject: [PATCH 20/36] Fixed deprecated uses of QVariant --- sources/properties/userproperties.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/properties/userproperties.cpp b/sources/properties/userproperties.cpp index cb7bff305..2085f9d63 100644 --- a/sources/properties/userproperties.cpp +++ b/sources/properties/userproperties.cpp @@ -44,17 +44,17 @@ QDomElement UserProperties::toXml(QDomDocument &xml_document) const for (auto i = m_properties.begin(); i != m_properties.end(); ++i) { - auto type = i.value().type(); + auto type = i.value().typeId(); switch(type) { - case QVariant::Type::String: + case QMetaType::QString: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toString())); break; - case QVariant::Type::Int: + case QMetaType::Int: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toInt())); break; - case QVariant::Type::Double: + case QMetaType::Double: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toDouble())); break; - case QVariant::Type::Bool: + case QMetaType::Bool: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toBool())); break; - case QVariant::Type::Color: + case QMetaType::QColor: up.appendChild(QETXML::createXmlProperty(i.key(), QColor(i.value().value()))); break; default: break; From 3c4a0ed2b45a8983ab1b99054140682a76fed3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 01:18:13 +0200 Subject: [PATCH 21/36] Fixed narrowing warning qsizetype -> int --- sources/TerminalStrip/terminalstrip.cpp | 2 +- sources/editor/elementscene.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/TerminalStrip/terminalstrip.cpp b/sources/TerminalStrip/terminalstrip.cpp index 2222a50fb..81ffef105 100644 --- a/sources/TerminalStrip/terminalstrip.cpp +++ b/sources/TerminalStrip/terminalstrip.cpp @@ -639,7 +639,7 @@ bool TerminalStrip::isBridgeable(const QVector> &re // Get the physical terminal and pos auto first_physical_terminal = first_real_terminal->physicalTerminal(); QVector physical_vector{first_physical_terminal}; - QVector pos_vector{m_physical_terminals.indexOf(first_physical_terminal)}; + QVector pos_vector{m_physical_terminals.indexOf(first_physical_terminal)}; auto bridge_ = isBridged(first_real_terminal); //bool to know at the end of this function if at least one terminal is not bridged diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index a9a64b65b..2b556e6f5 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -746,7 +746,7 @@ void ElementScene::addItems(QVector items) */ void ElementScene::removeItems(QVector items) { - const int previous_selected_count{selectedItems().size()}; + const qsizetype previous_selected_count{selectedItems().size()}; //block signal to avoid multiple emit of selection changed, //we emit this signal only once at the end of this function. From e332d3bf31d8066375cff89a9e9cb486b404bcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 01:39:22 +0200 Subject: [PATCH 22/36] Fixed compile warnings about QVariant::canConvert() --- sources/autoNum/numerotationcontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/autoNum/numerotationcontext.cpp b/sources/autoNum/numerotationcontext.cpp index 62f5d5686..f8d5830d6 100644 --- a/sources/autoNum/numerotationcontext.cpp +++ b/sources/autoNum/numerotationcontext.cpp @@ -57,9 +57,9 @@ bool NumerotationContext::addValue(const QString &type, const QVariant &value, const int increase, const int initialvalue) { - if (!keyIsAcceptable(type) && !value.canConvert(QVariant::String)) + if (!keyIsAcceptable(type) && !value.canConvert()) return false; - if (keyIsNumber(type) && !value.canConvert(QVariant::Int)) + if (keyIsNumber(type) && !value.canConvert()) return false; QString valuestr = value.toString(); From 4827b231160992178e21cd5c6d524591014653e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 01:43:09 +0200 Subject: [PATCH 23/36] Changed QtConcurrent::run() to QThreadPool::start() to fix compile warning --- sources/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/main.cpp b/sources/main.cpp index cf965fd4c..1633a1fad 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -23,7 +23,7 @@ #include "utils/qetsettings.h" #include -#include +#include /** @brief myMessageOutput @@ -216,7 +216,7 @@ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFacto QObject::connect(&app, &SingleApplication::receivedMessage, &qetapp, &QETApp::receiveMessage); - QtConcurrent::run([=]() + QThreadPool::globalInstance()->start([=]() { // for debugging qInstallMessageHandler(myMessageOutput); From 25f9f14b04aa16d70440b12344dfb35157ac0ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 02:03:37 +0200 Subject: [PATCH 24/36] Fixed deprecated qAsConst() to std::as_const() --- .../GraphicsItem/terminalstripdrawer.cpp | 2 +- .../UndoCommand/addterminaltostripcommand.cpp | 2 +- .../UndoCommand/groupterminalscommand.cpp | 4 ++-- sources/TerminalStrip/terminalstrip.cpp | 8 +++---- sources/TerminalStrip/terminalstripbridge.cpp | 2 +- .../TerminalStrip/ui/terminalstripmodel.cpp | 10 ++++----- .../ui/terminalstriptreedockwidget.cpp | 6 ++--- sources/diagram.cpp | 22 +++++++++---------- sources/diagramcontent.cpp | 8 +++---- sources/editor/ui/qetelementeditor.cpp | 4 ++-- sources/editor/ui/terminaleditor.cpp | 2 +- sources/editor/ui/texteditor.cpp | 2 +- sources/elementprovider.cpp | 8 +++---- sources/qetgraphicsitem/qetshapeitem.cpp | 2 +- sources/qetproject.cpp | 2 +- sources/ui/elementinfowidget.cpp | 4 ++-- .../ui/shapegraphicsitempropertieswidget.cpp | 2 +- .../undocommand/movegraphicsitemcommand.cpp | 4 ++-- 18 files changed, 47 insertions(+), 47 deletions(-) diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp index 1a82a6587..5364bf1d1 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp +++ b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp @@ -203,7 +203,7 @@ void TerminalStripDrawer::paint(QPainter *painter) painter->restore(); //Draw the bridges - for (const auto &points_ : qAsConst(bridges_anchor_points)) + for (const auto &points_ : std::as_const(bridges_anchor_points)) { painter->save(); auto pen_{painter->pen()}; diff --git a/sources/TerminalStrip/UndoCommand/addterminaltostripcommand.cpp b/sources/TerminalStrip/UndoCommand/addterminaltostripcommand.cpp index 8ae0cc0e2..a8c4fa34d 100644 --- a/sources/TerminalStrip/UndoCommand/addterminaltostripcommand.cpp +++ b/sources/TerminalStrip/UndoCommand/addterminaltostripcommand.cpp @@ -126,7 +126,7 @@ void RemoveTerminalFromStripCommand::redo() if (m_strip) { QVector> real_t; - for (const auto &real_t_vector : qAsConst(m_terminals)) { + for (const auto &real_t_vector : std::as_const(m_terminals)) { real_t.append(real_t_vector); } diff --git a/sources/TerminalStrip/UndoCommand/groupterminalscommand.cpp b/sources/TerminalStrip/UndoCommand/groupterminalscommand.cpp index d015da3ea..e9449cf67 100644 --- a/sources/TerminalStrip/UndoCommand/groupterminalscommand.cpp +++ b/sources/TerminalStrip/UndoCommand/groupterminalscommand.cpp @@ -68,7 +68,7 @@ void UnGroupTerminalsCommand::undo() m_terminal_strip->groupTerminals(key, m_physical_real_H.value(key)); } //Second, set level. - for (const auto &pair : qAsConst(m_real_t_level)) { + for (const auto &pair : std::as_const(m_real_t_level)) { m_terminal_strip->setLevel(pair.first, pair.second); } } @@ -78,7 +78,7 @@ void UnGroupTerminalsCommand::redo() { if (m_terminal_strip) { - for (const auto &value : qAsConst(m_physical_real_H)) { + for (const auto &value : std::as_const(m_physical_real_H)) { m_terminal_strip->unGroupTerminals(value); } } diff --git a/sources/TerminalStrip/terminalstrip.cpp b/sources/TerminalStrip/terminalstrip.cpp index 81ffef105..7a53bcebe 100644 --- a/sources/TerminalStrip/terminalstrip.cpp +++ b/sources/TerminalStrip/terminalstrip.cpp @@ -466,7 +466,7 @@ QSharedPointer TerminalStrip::realTerminalForUuid(const QUuid &uui QVector> TerminalStrip::realTerminals() const { QVector> vector_; - for (const auto &phy : qAsConst(m_physical_terminals)) { + for (const auto &phy : std::as_const(m_physical_terminals)) { vector_.append(phy->realTerminals()); } return vector_; @@ -856,7 +856,7 @@ QSharedPointer TerminalStrip::isBridged(const QSharedPointe { if (real_terminal) { - for (const auto &bridge_ : qAsConst(m_bridge)) { + for (const auto &bridge_ : std::as_const(m_bridge)) { if (bridge_->realTerminals().contains(real_terminal)) return bridge_; } @@ -983,7 +983,7 @@ QDomElement TerminalStrip::toXml(QDomDocument &parent_document) } root_elmt.appendChild(xml_layout); - for (const auto &bridge_ : qAsConst(m_bridge)) { + for (const auto &bridge_ : std::as_const(m_bridge)) { root_elmt.appendChild(bridge_->toXml(parent_document)); } @@ -1024,7 +1024,7 @@ bool TerminalStrip::fromXml(QDomElement &xml_element) for (auto &xml_real : QETXML::findInDomElement(xml_physical, RealTerminal::xmlTagName())) { const auto uuid_ = QUuid(xml_real.attribute(QStringLiteral("element_uuid"))); - for (auto terminal_elmt : qAsConst(free_terminals)) + for (auto terminal_elmt : std::as_const(free_terminals)) { if (terminal_elmt->uuid() == uuid_) { diff --git a/sources/TerminalStrip/terminalstripbridge.cpp b/sources/TerminalStrip/terminalstripbridge.cpp index f9fc3ef0f..23266ed95 100644 --- a/sources/TerminalStrip/terminalstripbridge.cpp +++ b/sources/TerminalStrip/terminalstripbridge.cpp @@ -85,7 +85,7 @@ QDomElement TerminalStripBridge::toXml(QDomDocument &parent_document) const root_elmt.setAttribute(QStringLiteral("color"), m_color.name()); auto terminals_elmt = parent_document.createElement(QStringLiteral("real_terminals")); - for (const auto &real_t : qAsConst(m_real_terminals)) + for (const auto &real_t : std::as_const(m_real_terminals)) { if (real_t) { diff --git a/sources/TerminalStrip/ui/terminalstripmodel.cpp b/sources/TerminalStrip/ui/terminalstripmodel.cpp index 7cd2c4014..bc73a03c8 100644 --- a/sources/TerminalStrip/ui/terminalstripmodel.cpp +++ b/sources/TerminalStrip/ui/terminalstripmodel.cpp @@ -535,7 +535,7 @@ modelRealTerminalData TerminalStripModel::dataAtRow(int row) const else { auto current_row = 0; - for (const auto &physical_data : qAsConst(m_physical_data)) + for (const auto &physical_data : std::as_const(m_physical_data)) { for (const auto &real_data : physical_data.real_data) { @@ -567,7 +567,7 @@ void TerminalStripModel::replaceDataAtRow(modelRealTerminalData data, int row) auto current_row = 0; auto current_physical = 0; - for (const auto &physical_data : qAsConst(m_physical_data)) + for (const auto &physical_data : std::as_const(m_physical_data)) { auto current_real = 0; for (int i=0 ; iname() < b->name(); }); - for (const auto &ts : qAsConst(ts_vector)) { + for (const auto &ts : std::as_const(ts_vector)) { addTerminalStrip(ts); } addFreeTerminal(); @@ -324,7 +324,7 @@ void TerminalStripTreeDockWidget::addFreeTerminal() auto free_terminal_item = ui->m_tree_view->topLevelItem(1); - for (const auto terminal : qAsConst(vector_)) + for (const auto terminal : std::as_const(vector_)) { QUuid uuid_ = terminal->uuid(); QStringList strl{terminal->actualLabel()}; diff --git a/sources/diagram.cpp b/sources/diagram.cpp index 91cc9b660..cf966db26 100644 --- a/sources/diagram.cpp +++ b/sources/diagram.cpp @@ -151,7 +151,7 @@ Diagram::~Diagram() continue; deletable_items.append(qgi); } - for (const auto &item : qAsConst(deletable_items)) + for (const auto &item : std::as_const(deletable_items)) { removeItem(item); delete item; @@ -1453,13 +1453,13 @@ bool Diagram::fromXml(QDomElement &document, if (position != QPointF()) { QVector added_items; - for (auto element : qAsConst(added_elements )) added_items << element; - for (auto cond : qAsConst(added_conductors )) added_items << cond; - for (auto shape : qAsConst(added_shapes )) added_items << shape; - for (auto text : qAsConst(added_texts )) added_items << text; - for (auto image : qAsConst(added_images )) added_items << image; - for (auto table : qAsConst(added_tables )) added_items << table; - for (const auto &strip : qAsConst(added_strips)) added_items << strip; + for (auto element : std::as_const(added_elements )) added_items << element; + for (auto cond : std::as_const(added_conductors )) added_items << cond; + for (auto shape : std::as_const(added_shapes )) added_items << shape; + for (auto text : std::as_const(added_texts )) added_items << text; + for (auto image : std::as_const(added_images )) added_items << image; + for (auto table : std::as_const(added_tables )) added_items << table; + for (const auto &strip : std::as_const(added_strips)) added_items << strip; //Get the top left corner of the rectangle that contain all added items QRectF items_rect; @@ -1568,11 +1568,11 @@ void Diagram::refreshContents() conductor->refreshText(); } - for (auto &table : qAsConst(dc_.m_tables)) { + for (auto &table : std::as_const(dc_.m_tables)) { table->initLink(); } - for (auto &strip :qAsConst(dc_.m_terminal_strip)) { + for (auto &strip :std::as_const(dc_.m_terminal_strip)) { strip->refreshPending(); } } @@ -1757,7 +1757,7 @@ void Diagram::invertSelection() item_list << item; } } - for (auto item : qAsConst(item_list)) { + for (auto item : std::as_const(item_list)) { item -> setSelected(!item -> isSelected()); } diff --git a/sources/diagramcontent.cpp b/sources/diagramcontent.cpp index 30bbcc5c1..caa0abb11 100644 --- a/sources/diagramcontent.cpp +++ b/sources/diagramcontent.cpp @@ -55,7 +55,7 @@ DiagramContent::DiagramContent(Diagram *diagram, bool selected) : item_list = diagram->items(); } - for (const auto &item : qAsConst(item_list)) + for (const auto &item : std::as_const(item_list)) { switch (item->type()) { @@ -391,10 +391,10 @@ QList DiagramContent::items(int filter) const if (filter & ElementTextFields) for(auto qgi : m_element_texts) items_list << qgi; if (filter & TextGroup) for(auto qgi : m_texts_groups) items_list << qgi; if (filter & Tables) for(auto qgi : m_tables) items_list << qgi; - if (filter & TerminalStrip) for(const auto qgi : qAsConst(m_terminal_strip)) items_list << qgi; + if (filter & TerminalStrip) for(const auto qgi : std::as_const(m_terminal_strip)) items_list << qgi; if (filter & SelectedOnly) { - for(const auto &qgi : qAsConst(items_list)) { + for(const auto &qgi : std::as_const(items_list)) { if (!qgi -> isSelected()) items_list.removeOne(qgi); } } @@ -420,7 +420,7 @@ int DiagramContent::count(int filter) const if (filter & ElementTextFields) for(auto deti : m_element_texts) { if (deti -> isSelected()) ++ count; } if (filter & TextGroup) for(auto etig : m_texts_groups) { if (etig -> isSelected()) ++ count; } if (filter & Tables) for(auto table : m_tables) { if (table -> isSelected()) ++ count; } - if (filter & TerminalStrip) for(const auto &strip : qAsConst(m_terminal_strip)) {if (strip->isSelected()) ++ count;} + if (filter & TerminalStrip) for(const auto &strip : std::as_const(m_terminal_strip)) {if (strip->isSelected()) ++ count;} } else { if (filter & Elements) count += m_elements.count(); diff --git a/sources/editor/ui/qetelementeditor.cpp b/sources/editor/ui/qetelementeditor.cpp index 4b510af21..9a1b61965 100644 --- a/sources/editor/ui/qetelementeditor.cpp +++ b/sources/editor/ui/qetelementeditor.cpp @@ -1069,7 +1069,7 @@ void QETElementEditor::updateAction() << ui->m_revert_selection_action << ui->m_paste_from_file_action << ui->m_paste_from_element_action; - for (auto action : qAsConst(ro_list)) { + for (auto action : std::as_const(ro_list)) { action->setDisabled(m_read_only); } @@ -1084,7 +1084,7 @@ void QETElementEditor::updateAction() << ui->m_flip_action << ui->m_mirror_action; auto items_selected = !m_read_only && m_elmt_scene->selectedItems().count(); - for (auto action : qAsConst(select_list)) { + for (auto action : std::as_const(select_list)) { action->setEnabled(items_selected); } diff --git a/sources/editor/ui/terminaleditor.cpp b/sources/editor/ui/terminaleditor.cpp index 11d9affa9..ac31eeece 100644 --- a/sources/editor/ui/terminaleditor.cpp +++ b/sources/editor/ui/terminaleditor.cpp @@ -229,7 +229,7 @@ void TerminalEditor::activeConnections(bool active) m_editor_connections << connect(ui->m_type_cb, QOverload::of(&QComboBox::activated), this, &TerminalEditor::typeEdited); } else { - for (auto const & con : qAsConst(m_editor_connections)) { + for (auto const & con : std::as_const(m_editor_connections)) { QObject::disconnect(con); } m_editor_connections.clear(); diff --git a/sources/editor/ui/texteditor.cpp b/sources/editor/ui/texteditor.cpp index 4dea81414..8689d741f 100644 --- a/sources/editor/ui/texteditor.cpp +++ b/sources/editor/ui/texteditor.cpp @@ -84,7 +84,7 @@ void TextEditor::setUpChangeConnection(QPointer part) void TextEditor::disconnectChangeConnection() { - for (const auto &connection : qAsConst(m_change_connection)) { + for (const auto &connection : std::as_const(m_change_connection)) { disconnect(connection); } m_change_connection.clear(); diff --git a/sources/elementprovider.cpp b/sources/elementprovider.cpp index f3bf9b308..442ad277c 100644 --- a/sources/elementprovider.cpp +++ b/sources/elementprovider.cpp @@ -59,11 +59,11 @@ QVector > ElementProvider::freeElement(ElementData::Types filt QList elmt_list; //search in all diagram - for (const auto &diagram_ : qAsConst(m_diagram_list)) + for (const auto &diagram_ : std::as_const(m_diagram_list)) { //get all element in diagram d elmt_list = diagram_->elements(); - for (const auto &elmt_ : qAsConst(elmt_list)) + for (const auto &elmt_ : std::as_const(elmt_list)) { if (filter & elmt_->elementData().m_type && elmt_->isFree()) @@ -106,7 +106,7 @@ QList ElementProvider::fromUuids(QList uuid_list) const QVector> ElementProvider::find(ElementData::Types elmt_type) const { QVector> returned_vector; - for (const auto &diagram_ : qAsConst(m_diagram_list)) + for (const auto &diagram_ : std::as_const(m_diagram_list)) { const auto elmt_list = diagram_->elements(); for (const auto &elmt_ : elmt_list) @@ -198,7 +198,7 @@ QVector ElementProvider::freeTerminal() const { QVector vector_; - for (const auto &diagram : qAsConst(m_diagram_list)) + for (const auto &diagram : std::as_const(m_diagram_list)) { const auto elmt_list{diagram->elements()}; diff --git a/sources/qetgraphicsitem/qetshapeitem.cpp b/sources/qetgraphicsitem/qetshapeitem.cpp index 019133eff..ae8de5898 100644 --- a/sources/qetgraphicsitem/qetshapeitem.cpp +++ b/sources/qetgraphicsitem/qetshapeitem.cpp @@ -594,7 +594,7 @@ void QetShapeItem::addHandler() { m_handler_vector = QetGraphicsHandlerItem::handlerForPoint(mapToScene(points_vector), QETUtils::graphicsHandlerSize(this)); - for(const auto handler : qAsConst(m_handler_vector)) + for(const auto handler : std::as_const(m_handler_vector)) { handler->setZValue(this->zValue()+1); handler->setColor(Qt::blue); diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index 63f51acc4..58835365a 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -2077,7 +2077,7 @@ void QETProject::updateDiagramsFolioData() } } - for (const auto &diagram_ : qAsConst(m_diagrams_list)) { + for (const auto &diagram_ : std::as_const(m_diagrams_list)) { diagram_->update(); } } diff --git a/sources/ui/elementinfowidget.cpp b/sources/ui/elementinfowidget.cpp index e2dd7d1a7..cedd14cce 100644 --- a/sources/ui/elementinfowidget.cpp +++ b/sources/ui/elementinfowidget.cpp @@ -203,7 +203,7 @@ void ElementInfoWidget::buildInterface() */ ElementInfoPartWidget *ElementInfoWidget::infoPartWidgetForKey(const QString &key) const { - for (const auto &eipw : qAsConst(m_eipw_list)) + for (const auto &eipw : std::as_const(m_eipw_list)) { if (eipw->key() == key) return eipw; @@ -245,7 +245,7 @@ DiagramContext ElementInfoWidget::currentInfo() const { DiagramContext info_; - for (const auto &eipw : qAsConst(m_eipw_list)) + for (const auto &eipw : std::as_const(m_eipw_list)) { //add value only if they're something to store diff --git a/sources/ui/shapegraphicsitempropertieswidget.cpp b/sources/ui/shapegraphicsitempropertieswidget.cpp index 2eb9eb8e0..fa2171eac 100644 --- a/sources/ui/shapegraphicsitempropertieswidget.cpp +++ b/sources/ui/shapegraphicsitempropertieswidget.cpp @@ -504,7 +504,7 @@ void ShapeGraphicsItemPropertiesWidget::setUpEditConnection() void ShapeGraphicsItemPropertiesWidget::clearEditConnection() { - for (const auto &c : qAsConst(m_edit_connection)) { + for (const auto &c : std::as_const(m_edit_connection)) { disconnect(c); } m_edit_connection.clear(); diff --git a/sources/undocommand/movegraphicsitemcommand.cpp b/sources/undocommand/movegraphicsitemcommand.cpp index 1140c968e..7220b7bfd 100644 --- a/sources/undocommand/movegraphicsitemcommand.cpp +++ b/sources/undocommand/movegraphicsitemcommand.cpp @@ -139,7 +139,7 @@ void MoveGraphicsItemCommand::move(const QPointF &movement) } //Move some conductors - for (const auto &conductor : qAsConst(m_content.m_conductors_to_move)) { + for (const auto &conductor : std::as_const(m_content.m_conductors_to_move)) { setupAnimation(conductor, "pos", conductor->pos(), @@ -147,7 +147,7 @@ void MoveGraphicsItemCommand::move(const QPointF &movement) } //Recalculate the path of other conductors - for (const auto &conductor : qAsConst(m_content.m_conductors_to_update)) { + for (const auto &conductor : std::as_const(m_content.m_conductors_to_update)) { setupAnimation(conductor, "animPath", 1, 1); } } From ee06a71e6f8ff5cc7c39def3c30d7252dfb5a9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 02:06:33 +0200 Subject: [PATCH 25/36] Fixed missing include --- sources/qetxml.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/qetxml.h b/sources/qetxml.h index d98756978..bf305d0ca 100644 --- a/sources/qetxml.h +++ b/sources/qetxml.h @@ -20,6 +20,8 @@ #include #include +#include + class QDomDocument; class QDir; From 5973db00f7a68eba05df0e3876b1c0bc5833fedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 02:23:41 +0200 Subject: [PATCH 26/36] Fixed deprecated use of QColor:setNamedColor() --- sources/TerminalStrip/terminalstripbridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/TerminalStrip/terminalstripbridge.cpp b/sources/TerminalStrip/terminalstripbridge.cpp index 23266ed95..b39b71c3f 100644 --- a/sources/TerminalStrip/terminalstripbridge.cpp +++ b/sources/TerminalStrip/terminalstripbridge.cpp @@ -106,7 +106,7 @@ void TerminalStripBridge::fromXml(const QDomElement &dom_element) } m_uuid = QUuid(dom_element.attribute(QStringLiteral("uuid"), m_uuid.toString())); - m_color.setNamedColor(dom_element.attribute(QStringLiteral("color"))); + m_color = QColor::fromString(dom_element.attribute(QStringLiteral("color"))); const auto real_t_vector = QETXML::subChild(dom_element, QStringLiteral("real_terminals"), From c77eb98a15ede820fe02768aebc2a3cb3e69b376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 9 Sep 2024 02:45:57 +0200 Subject: [PATCH 27/36] Fixed broken mapped signal for RecentFiles --- sources/recentfiles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/recentfiles.cpp b/sources/recentfiles.cpp index 7819f4f51..60a04e876 100644 --- a/sources/recentfiles.cpp +++ b/sources/recentfiles.cpp @@ -33,7 +33,7 @@ RecentFiles::RecentFiles(const QString &identifier, int size, QObject *parent) : menu_(nullptr) { mapper_ = new QSignalMapper(this); - connect(mapper_, SIGNAL(mapped(const QString &)), this, SLOT(handleMenuRequest(const QString &))); + connect(mapper_, &QSignalMapper::mappedString, this, &RecentFiles::handleMenuRequest); extractFilesFromSettings(); buildMenu(); From 9fefc7aa2a9965432e84f499ba0a8a5527b9bfc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Tue, 10 Sep 2024 22:23:46 +0200 Subject: [PATCH 28/36] Force Qt6 in cmake --- cmake/define_definitions.cmake | 2 +- tests/catch/CMakeLists.txt | 19 ++----------------- tests/googlemock/CMakeLists.txt | 19 ++----------------- tests/googletest/CMakeLists.txt | 19 ++----------------- tests/qttest/CMakeLists.txt | 21 ++------------------- 5 files changed, 9 insertions(+), 71 deletions(-) diff --git a/cmake/define_definitions.cmake b/cmake/define_definitions.cmake index c80cccef8..cd519f9d4 100644 --- a/cmake/define_definitions.cmake +++ b/cmake/define_definitions.cmake @@ -68,7 +68,7 @@ else() add_definitions(-DBUILD_WITHOUT_KF6) endif() message("QET_COMPONENTS :" ${QET_COMPONENTS}) -message("Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) +message("Qt version :" ${Qt6_VERSION}) if(QMFILES_AS_RESOURCE) add_definitions(-DQMFILES_AS_RESOURCE) diff --git a/tests/catch/CMakeLists.txt b/tests/catch/CMakeLists.txt index fb94de374..12b521320 100644 --- a/tests/catch/CMakeLists.txt +++ b/tests/catch/CMakeLists.txt @@ -40,23 +40,8 @@ if(NOT DEFINED QET_COMPONENTS) message(".. QET_COMPONENTS is not set !!! I set them up !!!") include(../../cmake/qet_compilation_vars.cmake) endif() -if(NOT DEFINED QT_VERSION_MAJOR) - find_package( - QT - NAMES - Qt6 - COMPONENTS - ${QET_COMPONENTS} - REQUIRED - ) -endif() - -find_package( - Qt${QT_VERSION_MAJOR} - COMPONENTS - ${QET_COMPONENTS} - REQUIRED) - message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) +find_package(Qt6 REQUIRED COMPONENTS ${QET_COMPONENTS}) +message(".. Qt version :" ${Qt6_VERSION}) Include(FetchContent) diff --git a/tests/googlemock/CMakeLists.txt b/tests/googlemock/CMakeLists.txt index 7f5464729..4badf58b3 100644 --- a/tests/googlemock/CMakeLists.txt +++ b/tests/googlemock/CMakeLists.txt @@ -40,23 +40,8 @@ if(NOT DEFINED QET_COMPONENTS) message(".. QET_COMPONENTS is not set !!! I set them up !!!") include(../../cmake/qet_compilation_vars.cmake) endif() -if(NOT DEFINED QT_VERSION_MAJOR) - find_package( - QT - NAMES - Qt6 - COMPONENTS - ${QET_COMPONENTS} - REQUIRED - ) -endif() - -find_package( - Qt${QT_VERSION_MAJOR} - COMPONENTS - ${QET_COMPONENTS} - REQUIRED) -message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) +find_package(Qt6 REQUIRED COMPONENTS ${QET_COMPONENTS}) +message(".. Qt version :" ${Qt6_VERSION}) Include(FetchContent) diff --git a/tests/googletest/CMakeLists.txt b/tests/googletest/CMakeLists.txt index 7192b0b06..df5a5caa2 100644 --- a/tests/googletest/CMakeLists.txt +++ b/tests/googletest/CMakeLists.txt @@ -40,23 +40,8 @@ if(NOT DEFINED QET_COMPONENTS) message(".. QET_COMPONENTS is not set !!! I set them up !!!") include(../../cmake/qet_compilation_vars.cmake) endif() -if(NOT DEFINED QT_VERSION_MAJOR) - find_package( - QT - NAMES - Qt6 - COMPONENTS - ${QET_COMPONENTS} - REQUIRED - ) -endif() - -find_package( - Qt${QT_VERSION_MAJOR} - COMPONENTS - ${QET_COMPONENTS} - REQUIRED) - message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) +find_package(Qt6 REQUIRED COMPONENTS ${QET_COMPONENTS}) +message(".. Qt version :" ${Qt6_VERSION}) Include(FetchContent) diff --git a/tests/qttest/CMakeLists.txt b/tests/qttest/CMakeLists.txt index 79dec51a9..126e39edf 100644 --- a/tests/qttest/CMakeLists.txt +++ b/tests/qttest/CMakeLists.txt @@ -40,25 +40,8 @@ if(NOT DEFINED QET_COMPONENTS) message(".. QET_COMPONENTS is not set !!! I set them up !!!") include(../../cmake/qet_compilation_vars.cmake) endif() -if(NOT DEFINED QT_VERSION_MAJOR) - find_package( - QT - NAMES - Qt6 - COMPONENTS - ${QET_COMPONENTS} - Test - REQUIRED - ) -endif() - -find_package( - Qt${QT_VERSION_MAJOR} - COMPONENTS - ${QET_COMPONENTS} - Test - REQUIRED) - message(".. Qt version :" ${Qt${QT_VERSION_MAJOR}_VERSION}) +find_package(Qt6 REQUIRED COMPONENTS Test ${QET_COMPONENTS}) +message(".. Qt version :" ${Qt6_VERSION}) include(../../cmake/fetch_kdeaddons.cmake) include(../../cmake/fetch_singleapplication.cmake) From 4ce8fcb0d4bb17433fa7f17800b4ef93bdd42828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Tue, 10 Sep 2024 22:24:09 +0200 Subject: [PATCH 29/36] Bump cmake minimum version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e11a782a5..0db0fe005 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ include(cmake/hoto_update_cmake_message.cmake) -cmake_minimum_required(VERSION 3.14...3.19 FATAL_ERROR) +cmake_minimum_required(VERSION 3.21.1 FATAL_ERROR) project(qelectrotech VERSION 0.9.0 From 3f7192dc68308421cb2c6cc6544bff8e041e48ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Tue, 10 Sep 2024 22:25:43 +0200 Subject: [PATCH 30/36] Rearraned and updated cmake-files --- CMakeLists.txt | 30 +++++++---------------- cmake/define_definitions.cmake | 2 +- cmake/fetch_kdeaddons.cmake | 41 +++++++++++++++++++++----------- cmake/qet_compilation_vars.cmake | 2 ++ 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0db0fe005..71cc5a530 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,13 @@ project(qelectrotech include(cmake/copyright_message.cmake) set(QET_DIR ${PROJECT_SOURCE_DIR}) +include(cmake/qet_compilation_vars.cmake) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +find_package(Qt6 REQUIRED COMPONENTS ${QET_COMPONENTS}) +qt_standard_project_setup() # Add sub directories option(PACKAGE_TESTS "Build the tests" ON) @@ -43,38 +50,17 @@ include(cmake/git_last_commit_sha.cmake) include(cmake/fetch_kdeaddons.cmake) include(cmake/fetch_singleapplication.cmake) include(cmake/fetch_pugixml.cmake) -include(cmake/qet_compilation_vars.cmake) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -SET(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -find_package( - QT - NAMES - Qt6 - COMPONENTS - ${QET_COMPONENTS} - REQUIRED - ) - -find_package( - Qt${QT_VERSION_MAJOR} - COMPONENTS - ${QET_COMPONENTS} - REQUIRED) set(CMAKE_AUTOUIC_SEARCH_PATHS ${QET_DIR}/sources/ui) # als laatse include(cmake/define_definitions.cmake) -add_executable( +qt_add_executable( ${PROJECT_NAME} ${QET_RES_FILES} ${QET_SRC_FILES} diff --git a/cmake/define_definitions.cmake b/cmake/define_definitions.cmake index cd519f9d4..cb9ad9b54 100644 --- a/cmake/define_definitions.cmake +++ b/cmake/define_definitions.cmake @@ -62,7 +62,7 @@ message("PROJECT_SOURCE_DIR :" ${PROJECT_SOURCE_DIR}) message("QET_DIR :" ${QET_DIR}) message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA}) -if(BUILD_WITH_KF6) +if(BUILD_WITH_KF6 AND BUILD_KF6) message("KF6_GIT_TAG :" ${KF6_GIT_TAG}) else() add_definitions(-DBUILD_WITHOUT_KF6) diff --git a/cmake/fetch_kdeaddons.cmake b/cmake/fetch_kdeaddons.cmake index 6ea692f8f..24f6ac5eb 100644 --- a/cmake/fetch_kdeaddons.cmake +++ b/cmake/fetch_kdeaddons.cmake @@ -14,42 +14,55 @@ # You should have received a copy of the GNU General Public License # along with QElectroTech. If not, see . -message(" - fetch_kdeaddons") +message(STATUS "fetch_kdeaddons") -if(DEFINED BUILD_WITH_KF6) - Include(FetchContent) - - option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" NO) +if(BUILD_WITH_KF6) + option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" OFF) + block(PROPAGATE KF6_GIT_TAG) + set(BUILD_TESTING OFF) + set(KDE_SKIP_TEST_SETTINGS ON) + set(BUILD_DESIGNERPLUGIN OFF) + set(KCOREADDONS_USE_QML OFF) + find_package(ECM REQUIRED NO_MODULE) + list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) + set(ecm_version ${ECM_VERSION}) if(BUILD_KF6) + Include(FetchContent) if(NOT DEFINED KF6_GIT_TAG) set(KF6_GIT_TAG v6.5.0) endif() - # - set(BUILD_TESTING OFF) - FetchContent_Declare( - ecm - GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git - GIT_TAG ${KF6_GIT_TAG}) - FetchContent_MakeAvailable(ecm) - FetchContent_Declare( kcoreaddons GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git GIT_TAG ${KF6_GIT_TAG}) FetchContent_MakeAvailable(kcoreaddons) + get_target_property(kca_version KF6::CoreAddons VERSION) FetchContent_Declare( kwidgetsaddons GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git GIT_TAG ${KF6_GIT_TAG}) FetchContent_MakeAvailable(kwidgetsaddons) + get_target_property(kwa_version KF6::WidgetsAddons VERSION) else() find_package(KF6CoreAddons REQUIRED) + set(kca_version ${KF6CoreAddons_VERSION}) find_package(KF6WidgetsAddons REQUIRED) - endif() + set(kwa_version ${KF6WidgetsAddons_VERSION}) + endif() + + get_target_property(kca_type KF6::WidgetsAddons TYPE) + get_target_property(kwa_type KF6::CoreAddons TYPE) + + message(NOTICE "ecm version : " ${ecm_version}) + message(NOTICE "kcoreaddons library : " ${kca_type}) + message(NOTICE "kcoreaddons version : " ${kca_version}) + message(NOTICE "kwidgetsaddons library : " ${kwa_type}) + message(NOTICE "kwidgetsaddons version : " ${kwa_version}) + endblock() set(KF6_PRIVATE_LIBRARIES KF6::WidgetsAddons diff --git a/cmake/qet_compilation_vars.cmake b/cmake/qet_compilation_vars.cmake index 85aa6ead8..d5752cf7c 100644 --- a/cmake/qet_compilation_vars.cmake +++ b/cmake/qet_compilation_vars.cmake @@ -17,6 +17,8 @@ message(" - qet_compilation_vars") set(QET_COMPONENTS + Core + Gui LinguistTools PrintSupport Xml From 1a24452e8b13737a3b9fd57608ac56fe844fd36f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Mon, 18 Nov 2024 20:20:09 +0100 Subject: [PATCH 31/36] Bump ECM / KF6 versions --- cmake/fetch_kdeaddons.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/fetch_kdeaddons.cmake b/cmake/fetch_kdeaddons.cmake index 24f6ac5eb..4e731ea46 100644 --- a/cmake/fetch_kdeaddons.cmake +++ b/cmake/fetch_kdeaddons.cmake @@ -23,15 +23,16 @@ if(BUILD_WITH_KF6) set(KDE_SKIP_TEST_SETTINGS ON) set(BUILD_DESIGNERPLUGIN OFF) set(KCOREADDONS_USE_QML OFF) - find_package(ECM REQUIRED NO_MODULE) + set(BUILD_QCH OFF) + set(BUILD_SHARED_LIBS OFF) + find_package(ECM 6.8.0 REQUIRED NO_MODULE) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - set(ecm_version ${ECM_VERSION}) if(BUILD_KF6) Include(FetchContent) if(NOT DEFINED KF6_GIT_TAG) - set(KF6_GIT_TAG v6.5.0) + set(KF6_GIT_TAG v6.8.0) endif() FetchContent_Declare( @@ -52,12 +53,12 @@ if(BUILD_WITH_KF6) set(kca_version ${KF6CoreAddons_VERSION}) find_package(KF6WidgetsAddons REQUIRED) set(kwa_version ${KF6WidgetsAddons_VERSION}) - endif() + endif() get_target_property(kca_type KF6::WidgetsAddons TYPE) get_target_property(kwa_type KF6::CoreAddons TYPE) - message(NOTICE "ecm version : " ${ecm_version}) + message(NOTICE "ecm version : " ${ECM_VERSION}) message(NOTICE "kcoreaddons library : " ${kca_type}) message(NOTICE "kcoreaddons version : " ${kca_version}) message(NOTICE "kwidgetsaddons library : " ${kwa_type}) From 1c2d83d586b8e16f280ef7ca5dd11c4ff45476c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sat, 15 Feb 2025 23:18:14 +0100 Subject: [PATCH 32/36] Fix compile error --- sources/machine_info.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/machine_info.cpp b/sources/machine_info.cpp index 56e2bfa28..b255820c4 100644 --- a/sources/machine_info.cpp +++ b/sources/machine_info.cpp @@ -188,7 +188,7 @@ void MachineInfo::send_info_to_debug() QDirIterator it1(QETApp::commonElementsDir().toLatin1(),nameFilters, QDir::Files, QDirIterator::Subdirectories); while (it1.hasNext()) { - if(it1.next() > 0 ) + if(it1.next() != "") { commomElementsDir ++; } @@ -200,7 +200,7 @@ void MachineInfo::send_info_to_debug() QDirIterator it2(QETApp::customElementsDir().toLatin1(), nameFilters, QDir::Files, QDirIterator::Subdirectories); while (it2.hasNext()) { - if(it2.next() > 0 ) + if(it2.next() != "") { customElementsDir ++; } @@ -211,7 +211,7 @@ void MachineInfo::send_info_to_debug() QDirIterator it3(QETApp::companyElementsDir().toLatin1(), nameFilters, QDir::Files, QDirIterator::Subdirectories); while (it3.hasNext()) { - if(it3.next() > 0 ) + if(it3.next() != "") { companyElementsDir ++; } From 4e030943bc7ee7f4b6978de30e17cb2c37322a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sat, 15 Feb 2025 23:51:52 +0100 Subject: [PATCH 33/36] Fix compile warning --- sources/elementscollectioncache.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sources/elementscollectioncache.cpp b/sources/elementscollectioncache.cpp index ea28ae341..d2b23063f 100644 --- a/sources/elementscollectioncache.cpp +++ b/sources/elementscollectioncache.cpp @@ -45,18 +45,19 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q qDebug() << "Unable to open the SQLite database " << database_path << " as " << connection_name << ": " << cache_db_.lastError(); else { - cache_db_.exec("PRAGMA temp_store = MEMORY"); - cache_db_.exec("PRAGMA journal_mode = MEMORY"); - cache_db_.exec("PRAGMA page_size = 4096"); - cache_db_.exec("PRAGMA cache_size = 16384"); - cache_db_.exec("PRAGMA locking_mode = EXCLUSIVE"); - cache_db_.exec("PRAGMA synchronous = OFF"); + QSqlQuery *temp_query = new QSqlQuery(cache_db_); + temp_query->exec("PRAGMA temp_store = MEMORY"); + temp_query->exec("PRAGMA journal_mode = MEMORY"); + temp_query->exec("PRAGMA page_size = 4096"); + temp_query->exec("PRAGMA cache_size = 16384"); + temp_query->exec("PRAGMA locking_mode = EXCLUSIVE"); + temp_query->exec("PRAGMA synchronous = OFF"); #if TODO_LIST #pragma message("@TODO the tables could already exist, handle that case.") #endif //@TODO the tables could already exist, handle that case. - cache_db_.exec("CREATE TABLE names" + temp_query->exec("CREATE TABLE names" "(" "path VARCHAR(512) NOT NULL," "locale VARCHAR(2) NOT NULL," @@ -65,12 +66,13 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q "PRIMARY KEY(path, locale)" ");"); - cache_db_.exec("CREATE TABLE pixmaps" + temp_query->exec("CREATE TABLE pixmaps" "(" "path VARCHAR(512) NOT NULL UNIQUE," "uuid VARCHAR(512) NOT NULL," "pixmap BLOB, PRIMARY KEY(path)," "FOREIGN KEY(path) REFERENCES names (path) ON DELETE CASCADE);"); + delete temp_query; // prepare queries select_name_ = new QSqlQuery(cache_db_); From aa36bb35e11f9b54160a0c183df8afdbc047b936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 16 Feb 2025 00:05:21 +0100 Subject: [PATCH 34/36] Fix compiler warning --- sources/machine_info.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/machine_info.cpp b/sources/machine_info.cpp index b255820c4..a7b6322eb 100644 --- a/sources/machine_info.cpp +++ b/sources/machine_info.cpp @@ -150,7 +150,7 @@ void MachineInfo::send_info_to_debug() qInfo()<< ""; qInfo()<< " OS System language:"<< QLocale::system().name(); - qInfo()<< " OS System Native Country Name:"<< QLocale::system().nativeCountryName(); + qInfo()<< " OS System Native Country Name:"<< QLocale::system().nativeTerritoryName(); qInfo()<< " OS System Native Language Name:"<< QLocale::system().nativeLanguageName(); qInfo()<< ""; qInfo()<< " System language defined in QET configuration:"<< QString(QETApp::langFromSetting().toLatin1()); From 572d78912c471750934548095be410a9a034de98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 16 Feb 2025 00:11:28 +0100 Subject: [PATCH 35/36] Fix compiler warning --- sources/dataBase/projectdatabase.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/dataBase/projectdatabase.cpp b/sources/dataBase/projectdatabase.cpp index 6ed800ad2..0df749f95 100644 --- a/sources/dataBase/projectdatabase.cpp +++ b/sources/dataBase/projectdatabase.cpp @@ -253,10 +253,12 @@ bool projectDataBase::createDataBase() return false; } - m_data_base.exec("PRAGMA temp_store = MEMORY"); - m_data_base.exec("PRAGMA journal_mode = MEMORY"); - m_data_base.exec("PRAGMA synchronous = OFF"); - + QSqlQuery *temp_query = new QSqlQuery(m_data_base); + temp_query->exec("PRAGMA temp_store = MEMORY"); + temp_query->exec("PRAGMA journal_mode = MEMORY"); + temp_query->exec("PRAGMA synchronous = OFF"); + delete temp_query; + QSqlQuery query_(m_data_base); bool first_ = true; From 49ce6bc4b33e37290fb45686653147802311eaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Hellstr=C3=B6mer?= Date: Sun, 16 Feb 2025 20:21:32 +0100 Subject: [PATCH 36/36] Update qet_be.ts to qet_nl_BE.ts --- cmake/qet_compilation_vars.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/qet_compilation_vars.cmake b/cmake/qet_compilation_vars.cmake index d5752cf7c..dffed9ff4 100644 --- a/cmake/qet_compilation_vars.cmake +++ b/cmake/qet_compilation_vars.cmake @@ -712,7 +712,6 @@ set(QET_SRC_FILES set(TS_FILES ${QET_DIR}/lang/qet_ar.ts - ${QET_DIR}/lang/qet_be.ts ${QET_DIR}/lang/qet_ca.ts ${QET_DIR}/lang/qet_cs.ts ${QET_DIR}/lang/qet_da.ts @@ -729,6 +728,7 @@ set(TS_FILES ${QET_DIR}/lang/qet_mn.ts ${QET_DIR}/lang/qet_nb.ts ${QET_DIR}/lang/qet_nl.ts + ${QET_DIR}/lang/qet_nl_BE.ts ${QET_DIR}/lang/qet_no.ts ${QET_DIR}/lang/qet_pl.ts ${QET_DIR}/lang/qet_pt.ts