mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 10:04:13 +02:00
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:
@@ -179,8 +179,8 @@ void QETDiagramEditor::setUpElementsPanel()
|
|||||||
|
|
||||||
addDockWidget(Qt::LeftDockWidgetArea, qdw_pa);
|
addDockWidget(Qt::LeftDockWidgetArea, qdw_pa);
|
||||||
|
|
||||||
connect(pa, SIGNAL(requestForProject (QETProject *)), this, SLOT(activateProject(QETProject *)));
|
connect(pa, &ElementsPanelWidget::requestForProject, this, qOverload<QETProject*>(&QETDiagramEditor::activateProject));
|
||||||
connect(pa, SIGNAL(requestForProjectClosing (QETProject *)), this, SLOT(closeProject(QETProject *)));
|
connect(pa, &ElementsPanelWidget::requestForProjectClosing, this, qOverload<QETProject*>(&QETDiagramEditor::closeProject));
|
||||||
connect(pa, SIGNAL(requestForProjectPropertiesEdition (QETProject *)), this, SLOT(editProjectProperties(QETProject *)));
|
connect(pa, SIGNAL(requestForProjectPropertiesEdition (QETProject *)), this, SLOT(editProjectProperties(QETProject *)));
|
||||||
connect(pa, &ElementsPanelWidget::requestForNewDiagram, this, &QETDiagramEditor::addDiagramToProject);
|
connect(pa, &ElementsPanelWidget::requestForNewDiagram, this, &QETDiagramEditor::addDiagramToProject);
|
||||||
connect(pa, SIGNAL(requestForDiagramPropertiesEdition (Diagram *)), this, SLOT(editDiagramProperties(Diagram *)));
|
connect(pa, SIGNAL(requestForDiagramPropertiesEdition (Diagram *)), this, SLOT(editDiagramProperties(Diagram *)));
|
||||||
@@ -1933,8 +1933,7 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view)
|
|||||||
this, &QETDiagramEditor::findElementInPanel);
|
this, &QETDiagramEditor::findElementInPanel);
|
||||||
|
|
||||||
// display error messages sent by the project view
|
// display error messages sent by the project view
|
||||||
connect(project_view, SIGNAL(errorEncountered(QString)),
|
connect(project_view, &ProjectView::errorEncountered, this, qOverload<const QString&>(&QETDiagramEditor::showError));
|
||||||
this, SLOT(showError(const QString &)));
|
|
||||||
|
|
||||||
//Highlight the current page
|
//Highlight the current page
|
||||||
connect(project_view, &ProjectView::diagramActivated, this, [this](DiagramView *dv) {
|
connect(project_view, &ProjectView::diagramActivated, this, [this](DiagramView *dv) {
|
||||||
|
|||||||
Reference in New Issue
Block a user