From 7facb1cbf8619e2ca3c46fc145acc0684c0a93c3 Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Mon, 28 Sep 2026 23:00:58 +0200 Subject: [PATCH 1/5] Fix cast which becomes a warning in C++20. --- sources/materiallist/materialselectiondialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/materiallist/materialselectiondialog.cpp b/sources/materiallist/materialselectiondialog.cpp index d7265de7e..ba1aabfb5 100644 --- a/sources/materiallist/materialselectiondialog.cpp +++ b/sources/materiallist/materialselectiondialog.cpp @@ -373,7 +373,7 @@ bool MaterialSelectionDialog::eventFilter(QObject *watched, QEvent *event) static int wheelAmount(int delta, bool counting_items) { if (counting_items) { - return 3 * qRound(double(delta) / QWheelEvent::DefaultDeltasPerStep); + return 3 * qRound(static_cast(delta) / static_cast(QWheelEvent::DefaultDeltasPerStep)); } return delta; } From 574d6dcd56f15e6e08560077bb429a6d3f0a6ae2 Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Mon, 28 Sep 2026 23:01:42 +0200 Subject: [PATCH 2/5] Fix captor operator [=] which needs to be written explciitly [this] in C++20. --- .../TerminalStrip/ui/freeterminaleditor.cpp | 2 +- .../TerminalStrip/ui/terminalstripeditor.cpp | 2 +- .../TerminalStrip/ui/terminalstripmodel.cpp | 2 +- sources/diagramview.cpp | 2 +- sources/editor/ui/dynamictextfieldeditor.cpp | 24 +++++++++---------- sources/qetdiagrameditor.cpp | 6 ++--- sources/qetproject.cpp | 2 +- sources/ui/linksingleelementwidget.cpp | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sources/TerminalStrip/ui/freeterminaleditor.cpp b/sources/TerminalStrip/ui/freeterminaleditor.cpp index 70ebea752..e9863f448 100644 --- a/sources/TerminalStrip/ui/freeterminaleditor.cpp +++ b/sources/TerminalStrip/ui/freeterminaleditor.cpp @@ -52,7 +52,7 @@ FreeTerminalEditor::FreeTerminalEditor(QETProject *project, QWidget *parent) : connect(ui->m_table_view->selectionModel(), &QItemSelectionModel::selectionChanged, this, &FreeTerminalEditor::selectionChanged); - connect(ui->m_table_view, &QAbstractItemView::doubleClicked, this, [=](const QModelIndex &index) + connect(ui->m_table_view, &QAbstractItemView::doubleClicked, this, [this](const QModelIndex &index) { if (m_model->columnTypeForIndex(index) == FreeTerminalModel::XRef) { diff --git a/sources/TerminalStrip/ui/terminalstripeditor.cpp b/sources/TerminalStrip/ui/terminalstripeditor.cpp index 364aa8acc..d0adf173e 100644 --- a/sources/TerminalStrip/ui/terminalstripeditor.cpp +++ b/sources/TerminalStrip/ui/terminalstripeditor.cpp @@ -53,7 +53,7 @@ TerminalStripEditor::TerminalStripEditor(QETProject *project, QWidget *parent) : selectionChanged(); //Go the diagram of double clicked terminal - connect(ui->m_table_widget, &QAbstractItemView::doubleClicked, this, [=](const QModelIndex &index) + connect(ui->m_table_widget, &QAbstractItemView::doubleClicked, this, [this](const QModelIndex &index) { if (m_model->columnTypeForIndex(index) == TerminalStripModel::XRef) { diff --git a/sources/TerminalStrip/ui/terminalstripmodel.cpp b/sources/TerminalStrip/ui/terminalstripmodel.cpp index db7f39d54..116803636 100644 --- a/sources/TerminalStrip/ui/terminalstripmodel.cpp +++ b/sources/TerminalStrip/ui/terminalstripmodel.cpp @@ -110,7 +110,7 @@ TerminalStripModel::TerminalStripModel(TerminalStrip *terminal_strip, QObject *p { fillPhysicalTerminalData(); - connect(terminal_strip, &TerminalStrip::bridgeColorChanged, this, [=] { + connect(terminal_strip, &TerminalStrip::bridgeColorChanged, this, [this] { emit dataChanged(index(0, LEVEL_0_CELL), index(rowCount(), LEVEL_3_CELL)); }); diff --git a/sources/diagramview.cpp b/sources/diagramview.cpp index 8e49a1fe3..b4c5cf126 100644 --- a/sources/diagramview.cpp +++ b/sources/diagramview.cpp @@ -1752,7 +1752,7 @@ void DiagramView::setEventInterface(DVEventInterface *event_interface) { if (m_event_interface) delete m_event_interface; m_event_interface = event_interface; - connect(m_event_interface, &DVEventInterface::finish, this, [=](){delete this->m_event_interface; this->m_event_interface = nullptr;}, Qt::QueuedConnection); + connect(m_event_interface, &DVEventInterface::finish, this, [this](){delete this->m_event_interface; this->m_event_interface = nullptr;}, Qt::QueuedConnection); } /** diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index 7cd15dd62..3f444a8e3 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -199,18 +199,18 @@ void DynamicTextFieldEditor::setUpConnections() disconnectConnections(); //Setup the connection - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::colorChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::fontChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::taggChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textFromChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::infoNameChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::rotationChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::frameChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textWidthChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::compositeTextChanged,this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::keepVisualRotationChanged, this, [=](){this -> updateForm();}); - m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::rotationPointCenterChanged, this, [=](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::colorChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::fontChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::taggChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textFromChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::infoNameChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::rotationChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::frameChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textWidthChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::compositeTextChanged,this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::keepVisualRotationChanged, this, [this](){this -> updateForm();}); + m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::rotationPointCenterChanged, this, [this](){this -> updateForm();}); // Refresh info combo when element data changes (e.g. type switched to PLC-Slave) m_connection_list << connect(elementEditor()->elementScene(), &ElementScene::elementInfoChanged, diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 80d52f4dd..08434ce16 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -612,7 +612,7 @@ void QETDiagramEditor::setUpActions() //Add a nomenclature item m_add_nomenclature = new QAction(QET::Icons::TableOfContent, tr("Ajouter une nomenclature"), this); - connect(m_add_nomenclature, &QAction::triggered, this, [=]() { + connect(m_add_nomenclature, &QAction::triggered, this, [this]() { if(this->currentDiagramView()) { QetGraphicsTableFactory::createAndAddNomenclature(this->currentDiagramView()->diagram()); } @@ -620,14 +620,14 @@ void QETDiagramEditor::setUpActions() //Add a summary item m_add_summary = new QAction(QET::Icons::TableOfContent, tr("Ajouter un sommaire"), this); - connect(m_add_summary, &QAction::triggered, this, [=]() { + connect(m_add_summary, &QAction::triggered, this, [this]() { if(this->currentDiagramView()) { QetGraphicsTableFactory::createAndAddSummary(this->currentDiagramView()->diagram()); } }); m_terminal_strip_dialog = new QAction(QET::Icons::TerminalStrip, tr("Gestionnaire de borniers (DEV)"), this); - connect(m_terminal_strip_dialog, &QAction::triggered, this, [=]() + connect(m_terminal_strip_dialog, &QAction::triggered, this, [this]() { if (auto project = this->currentProject()) { diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index b89acc626..aae5a8bae 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -346,7 +346,7 @@ void QETProject::init() { int ms = autosave_interval*60*1000; m_autosave_timer.setInterval(ms); - connect(&m_autosave_timer, &QTimer::timeout, this, [=]() + connect(&m_autosave_timer, &QTimer::timeout, this, [this]() { if(!this->m_file_path.isEmpty()) this->write(); diff --git a/sources/ui/linksingleelementwidget.cpp b/sources/ui/linksingleelementwidget.cpp index 322e955bf..67817dcfa 100644 --- a/sources/ui/linksingleelementwidget.cpp +++ b/sources/ui/linksingleelementwidget.cpp @@ -73,7 +73,7 @@ LinkSingleElementWidget::LinkSingleElementWidget(Element *elmt, connect(ui->m_hide_full_masters_cb, &QCheckBox::toggled, this, &LinkSingleElementWidget::hideFullMastersToggled); - connect(m_show_qtwi, &QAction::triggered, this, [=]() + connect(m_show_qtwi, &QAction::triggered, this, [this]() { this->on_m_tree_widget_itemDoubleClicked(this->m_qtwi_at_context_menu, 0); }); @@ -83,7 +83,7 @@ LinkSingleElementWidget::LinkSingleElementWidget(Element *elmt, this, &LinkSingleElementWidget::linkTriggered); - connect(m_show_element, &QAction::triggered, this, [=]() + connect(m_show_element, &QAction::triggered, this, [this]() { this->m_element->diagram()->showMe(); this->m_element->setHighlighted(true); From 2b813a0d91fbacdc0918fddd95f4a9a1ed77ed0a Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Mon, 28 Sep 2026 23:03:11 +0200 Subject: [PATCH 3/5] Fix Qt6 package name which was forgotten when removing the variable used to differentiate between Qt5 nd Qt6. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1694a98c0..9ede16889 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,8 +93,8 @@ endif() # the application depends on. When it's missing the feature is silently # disabled - see the QET_HAS_SCRIPTING guard in qetscripting.*. set(QET_HAS_SCRIPTING FALSE) -find_package(Qt${QT_VERSION_MAJOR} QUIET COMPONENTS Qml) -if(TARGET Qt${QT_VERSION_MAJOR}::Qml) +find_package(Qt6 QUIET COMPONENTS Qml) +if(TARGET Qt6::Qml) set(QET_HAS_SCRIPTING TRUE) list(APPEND QET_PRIVATE_LIBRARIES Qt::Qml) add_compile_definitions(QET_HAS_SCRIPTING) From a72384850a042ca6aab2057640458225598c18ca Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Mon, 28 Sep 2026 23:19:46 +0200 Subject: [PATCH 4/5] Replace depreciated aAdConst with STL. --- sources/shortcutmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/shortcutmanager.cpp b/sources/shortcutmanager.cpp index 56d43b228..0ea6f2acd 100644 --- a/sources/shortcutmanager.cpp +++ b/sources/shortcutmanager.cpp @@ -181,7 +181,7 @@ bool ShortcutManager::trigger(const QString &id) const return false; } - for (const QPointer &target : qAsConst(it->targets)) + for (const QPointer &target : std::as_const(it->targets)) { if (!target) { continue; @@ -213,7 +213,7 @@ QAction *ShortcutManager::action(const QString &id, const QObject *owner) const return nullptr; } - for (const QPointer &target : qAsConst(it->targets)) + for (const QPointer &target : std::as_const(it->targets)) { auto *action = qobject_cast(target.data()); if (!action) { From 91ef85f891ac199da74f7c39a5446e9d281b2c73 Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Mon, 28 Sep 2026 23:38:01 +0200 Subject: [PATCH 5/5] Unify Qt6:: usage. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ede16889..a14f309f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,7 @@ set(QET_HAS_QTPDF FALSE) find_package(Qt6 QUIET COMPONENTS Pdf) if(TARGET Qt6::Pdf AND NOT Qt6_VERSION VERSION_LESS 6.4.0) set(QET_HAS_QTPDF TRUE) - list(APPEND QET_PRIVATE_LIBRARIES Qt::Pdf) + list(APPEND QET_PRIVATE_LIBRARIES Qt6::Pdf) add_compile_definitions(QET_HAS_QTPDF) else() message(STATUS "QtPdf module not available (or Qt < 6.4): PDF page import feature disabled") @@ -96,7 +96,7 @@ set(QET_HAS_SCRIPTING FALSE) find_package(Qt6 QUIET COMPONENTS Qml) if(TARGET Qt6::Qml) set(QET_HAS_SCRIPTING TRUE) - list(APPEND QET_PRIVATE_LIBRARIES Qt::Qml) + list(APPEND QET_PRIVATE_LIBRARIES Qt6::Qml) add_compile_definitions(QET_HAS_SCRIPTING) else() message(STATUS "Qt Qml module not available: JavaScript scripting (--run) disabled")