From b3de01d171b9eacc84ca07faa697d46c8eba8de7 Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Sat, 8 Aug 2026 21:50:28 +0200 Subject: [PATCH] Migrating more signal/slot to the new member pointer system. Unlike the earlier signal-side overload fixes (QComboBox/QSpinBox etc.), these three are ambiguous on the *slot* side: activateProject(QETProject*)/activateProject(ProjectView*), closeProject(ProjectView*)/closeProject(QETProject*), and showError(const QETResult&)/showError(const QString&) each have two declarations on QETDiagramEditor. &QETDiagramEditor::activateProject etc. alone won't compile with two candidates present; qOverload() picks the one matching the actual signal's argument type, same as the old SIGNAL()/SLOT() macro text did implicitly. --- sources/qetdiagrameditor.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 32ca046cf..c9665f123 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -179,8 +179,8 @@ void QETDiagramEditor::setUpElementsPanel() addDockWidget(Qt::LeftDockWidgetArea, qdw_pa); - connect(pa, SIGNAL(requestForProject (QETProject *)), this, SLOT(activateProject(QETProject *))); - connect(pa, SIGNAL(requestForProjectClosing (QETProject *)), this, SLOT(closeProject(QETProject *))); + connect(pa, &ElementsPanelWidget::requestForProject, this, qOverload(&QETDiagramEditor::activateProject)); + connect(pa, &ElementsPanelWidget::requestForProjectClosing, this, qOverload(&QETDiagramEditor::closeProject)); connect(pa, SIGNAL(requestForProjectPropertiesEdition (QETProject *)), this, SLOT(editProjectProperties(QETProject *))); connect(pa, &ElementsPanelWidget::requestForNewDiagram, this, &QETDiagramEditor::addDiagramToProject); connect(pa, SIGNAL(requestForDiagramPropertiesEdition (Diagram *)), this, SLOT(editDiagramProperties(Diagram *))); @@ -1933,8 +1933,7 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view) this, &QETDiagramEditor::findElementInPanel); // display error messages sent by the project view - connect(project_view, SIGNAL(errorEncountered(QString)), - this, SLOT(showError(const QString &))); + connect(project_view, &ProjectView::errorEncountered, this, qOverload(&QETDiagramEditor::showError)); //Highlight the current page connect(project_view, &ProjectView::diagramActivated, this, [this](DiagramView *dv) {