New Signal Slot Syntax

This commit is contained in:
Simon De Backer 2020-08-02 15:23:38 +02:00
parent 510aa74266
commit 4751934d68
2 changed files with 40 additions and 32 deletions

View File

@ -88,13 +88,25 @@ Diagram::Diagram(QETProject *project) :
pen.setColor(Qt::black);
conductor_setter_ -> setPen(pen);
connect(&border_and_titleblock, SIGNAL(needTitleBlockTemplate(const QString &)), this, SLOT(setTitleBlockTemplate(const QString &)));
connect(&border_and_titleblock, SIGNAL(diagramTitleChanged(const QString &)), this, SLOT(titleChanged(const QString &)));
connect(&border_and_titleblock, SIGNAL(titleBlockFolioChanged(const QString &)), this, SLOT(titleChanged(const QString &)));
connect(&border_and_titleblock, SIGNAL(borderChanged(QRectF,QRectF)), this, SLOT(adjustSceneRect()));
connect(&border_and_titleblock, SIGNAL(titleBlockFolioChanged(const QString &)), this, SLOT(updateLabels()));
connect(this, SIGNAL (diagramActivated()), this, SLOT(loadElmtFolioSeq()));
connect(this, SIGNAL (diagramActivated()), this, SLOT(loadCndFolioSeq()));
connect(&border_and_titleblock,
&BorderTitleBlock::needTitleBlockTemplate,
this, &Diagram::setTitleBlockTemplate);
connect(&border_and_titleblock,
&BorderTitleBlock::diagramTitleChanged,
this, &Diagram::titleChanged);
connect(&border_and_titleblock,
&BorderTitleBlock::titleBlockFolioChanged,
this, &Diagram::titleChanged);
connect(&border_and_titleblock,
&BorderTitleBlock::borderChanged,
this, &Diagram::adjustSceneRect);
connect(&border_and_titleblock,
&BorderTitleBlock::titleBlockFolioChanged,
this, &Diagram::updateLabels);
connect(this, &Diagram::diagramActivated,
this, &Diagram::loadElmtFolioSeq);
connect(this, &Diagram::diagramActivated,
this, &Diagram::loadCndFolioSeq);
adjustSceneRect();
}

View File

@ -189,13 +189,11 @@ QTreeWidgetItem *GenericPanel::updateProjectItem(QTreeWidgetItem *project_qtwi,
projects_.insert(project, project_qtwi);
connect(
project, SIGNAL(projectInformationsChanged(QETProject *)),
this, SLOT (projectInformationsChanged(QETProject *))
);
project,&QETProject::projectInformationsChanged,
this,&GenericPanel::projectInformationsChanged);
connect(
project, SIGNAL(readOnlyChanged(QETProject *, bool)),
this, SLOT (projectInformationsChanged(QETProject *))
);
project,&QETProject::readOnlyChanged,
this,&GenericPanel::projectInformationsChanged);
}
// text
@ -236,17 +234,14 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi,
if (options & AddChildDiagrams) {
if (freshly_created) {
connect(
project, SIGNAL(diagramAdded(QETProject *, Diagram *)),
this, SLOT (diagramAdded(QETProject *, Diagram *))
);
project,&QETProject::diagramAdded,
this,&GenericPanel::diagramAdded);
connect(
project, SIGNAL(diagramRemoved(QETProject *, Diagram *)),
this, SLOT (diagramRemoved(QETProject *, Diagram *))
);
project,&QETProject::diagramRemoved,
this,&GenericPanel::diagramRemoved);
connect(
project, SIGNAL(projectDiagramsOrderChanged(QETProject *, int, int)),
this, SLOT (projectDiagramsOrderChanged(QETProject *, int, int))
);
project,&QETProject::projectDiagramsOrderChanged,
this,&GenericPanel::projectDiagramsOrderChanged);
} else {
// remove diagrams unknown to the project (presumably removed)
removeObsoleteItems(project -> diagrams(),
@ -265,9 +260,8 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi,
if (options & AddChildTemplatesCollection) {
if (freshly_created) {
connect(
project, SIGNAL(diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &)),
this, SLOT (diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &))
);
project,&QETProject::diagramUsedTemplate,
this,&GenericPanel::diagramUsedTemplate);
}
addTemplatesCollection(
project -> embeddedTitleBlockTemplatesCollection(),
@ -388,7 +382,8 @@ QTreeWidgetItem *GenericPanel::updateDiagramItem(QTreeWidgetItem *diagram_qtwi,
QVariant::fromValue(diagram));
diagrams_.insert(diagram, diagram_qtwi);
connect(diagram, &Diagram::diagramTitleChanged, this, &GenericPanel::diagramTitleChanged);
connect(diagram, &Diagram::diagramTitleChanged,
this, &GenericPanel::diagramTitleChanged);
}
return(updateItem(diagram_qtwi, options, freshly_created));
@ -528,14 +523,15 @@ QTreeWidgetItem *GenericPanel::fillTemplatesCollectionItem(
if (options & AddChildTemplates) {
if (freshly_created) {
connect(
tbt_collection, SIGNAL(changed(TitleBlockTemplatesCollection*,QString)),
this, SLOT(templatesCollectionChanged(TitleBlockTemplatesCollection*, const QString &))
);
tbt_collection,
&TitleBlockTemplatesCollection::changed,
this,
&GenericPanel::templatesCollectionChanged);
if (QETProject *project = tbt_collection -> parentProject()) {
connect(
project, SIGNAL(diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &)),
this, SLOT (templatesCollectionChanged(TitleBlockTemplatesCollection *, const QString &))
);
project, &QETProject::diagramUsedTemplate,
this,
&GenericPanel::templatesCollectionChanged);
}
} else {
// remove templates unknown to the collection (presumably removed)