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<T>() picks the one matching the actual signal's argument type, same as
the old SIGNAL()/SLOT() macro text did implicitly.
This commit is contained in:
Andre Rummler
2026-08-08 21:50:28 +02:00
parent 90950075bf
commit b3de01d171
+3 -4
View File
@@ -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<QETProject*>(&QETDiagramEditor::activateProject));
connect(pa, &ElementsPanelWidget::requestForProjectClosing, this, qOverload<QETProject*>(&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<const QString&>(&QETDiagramEditor::showError));
//Highlight the current page
connect(project_view, &ProjectView::diagramActivated, this, [this](DiagramView *dv) {