mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-15 11:04:12 +02:00
Merge pull request #698 from arummler/master-modernize-signal-slot
Migrate string based signal/slot to method pointer
This commit is contained in:
@@ -110,7 +110,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project,
|
||||
xrefpw -> setProperties (m_project -> defaultXRefProperties());
|
||||
}
|
||||
|
||||
connect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
|
||||
connect(ipw, &TitleBlockPropertiesWidget::openAutoNumFolioEditor, this, &NewDiagramPage::changeToAutoFolioTab);
|
||||
|
||||
// main tab widget
|
||||
QTabWidget *tab_widget = new QTabWidget(this);
|
||||
@@ -138,7 +138,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project,
|
||||
*/
|
||||
NewDiagramPage::~NewDiagramPage()
|
||||
{
|
||||
disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
|
||||
disconnect(ipw, &TitleBlockPropertiesWidget::openAutoNumFolioEditor, this, &NewDiagramPage::changeToAutoFolioTab);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -391,7 +391,7 @@ void ProjectAutoNumConfigPage::adjustReadOnly()
|
||||
void ProjectAutoNumConfigPage::buildConnections()
|
||||
{
|
||||
//Management Tab
|
||||
connect (m_amw, SIGNAL(applyPressed()), this, SLOT(applyManagement()));
|
||||
connect(m_amw, &AutoNumberingManagementW::applyPressed, this, &ProjectAutoNumConfigPage::applyManagement);
|
||||
|
||||
//Conductor Tab
|
||||
connect(m_saw_conductor, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextConductor);
|
||||
@@ -421,7 +421,7 @@ void ProjectAutoNumConfigPage::buildConnections()
|
||||
#endif
|
||||
|
||||
// Auto Folio Numbering
|
||||
connect (m_faw, SIGNAL (applyPressed()), this, SLOT (applyAutoNum()));
|
||||
connect(m_faw, &FolioAutonumberingW::applyPressed, this, &ProjectAutoNumConfigPage::applyAutoNum);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ DiagramContextWidget::DiagramContextWidget(QWidget *parent) :
|
||||
ui(new Ui::DiagramContextWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->m_table, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(checkTableRows()));
|
||||
connect(ui->m_table, &QTableWidget::itemChanged, this, &DiagramContextWidget::checkTableRows);
|
||||
}
|
||||
|
||||
DiagramContextWidget::~DiagramContextWidget()
|
||||
|
||||
@@ -62,7 +62,7 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
titleblock_infos = new TitleBlockPropertiesWidget(titleblock, false, diagram->project(), this);
|
||||
|
||||
titleblock_infos -> setReadOnly(diagram_is_read_only);
|
||||
connect(titleblock_infos,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(editAutoFolioNum()));
|
||||
connect(titleblock_infos, &TitleBlockPropertiesWidget::openAutoNumFolioEditor, this, &DiagramPropertiesDialog::editAutoFolioNum);
|
||||
//titleblock_infos->setMinimumSize(590,480); //Minimum Size needed for correct display
|
||||
|
||||
//Conductor widget
|
||||
@@ -77,8 +77,8 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
|
||||
|
||||
// Buttons
|
||||
QDialogButtonBox boutons(diagram_is_read_only ? QDialogButtonBox::Ok : QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
connect(&boutons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(&boutons, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(&boutons, &QDialogButtonBox::accepted, this, &DiagramPropertiesDialog::accept);
|
||||
connect(&boutons, &QDialogButtonBox::rejected, this, &DiagramPropertiesDialog::reject);
|
||||
|
||||
QGridLayout *glayout = new QGridLayout;
|
||||
glayout->addWidget(border_infos,0,0);
|
||||
|
||||
@@ -45,19 +45,15 @@ void DiagramPropertiesEditorDockWidget::setDiagram(Diagram *diagram)
|
||||
|
||||
if (m_diagram)
|
||||
{
|
||||
disconnect(m_diagram, SIGNAL(selectionChanged()),
|
||||
this, SLOT(selectionChanged()));
|
||||
disconnect(m_diagram, SIGNAL(destroyed()),
|
||||
this, SLOT(diagramWasDeleted()));
|
||||
disconnect(m_diagram, &Diagram::selectionChanged, this, &DiagramPropertiesEditorDockWidget::selectionChanged);
|
||||
disconnect(m_diagram, &QObject::destroyed, this, &DiagramPropertiesEditorDockWidget::diagramWasDeleted);
|
||||
}
|
||||
|
||||
if (diagram)
|
||||
{
|
||||
m_diagram = diagram;
|
||||
connect(m_diagram, SIGNAL(selectionChanged()),
|
||||
this, SLOT(selectionChanged()), Qt::QueuedConnection);
|
||||
connect(m_diagram, SIGNAL(destroyed()),
|
||||
this, SLOT(diagramWasDeleted()));
|
||||
connect(m_diagram, &Diagram::selectionChanged, this, &DiagramPropertiesEditorDockWidget::selectionChanged, Qt::QueuedConnection);
|
||||
connect(m_diagram, &QObject::destroyed, this, &DiagramPropertiesEditorDockWidget::diagramWasDeleted);
|
||||
selectionChanged();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -148,7 +148,7 @@ bool ElementInfoWidget::event(QEvent *event)
|
||||
{
|
||||
if (event -> type() == QEvent::WindowActivate || event -> type() == QEvent::Show)
|
||||
{
|
||||
QTimer::singleShot(250, this, SLOT(firstActivated()));
|
||||
QTimer::singleShot(250, this, &ElementInfoWidget::firstActivated);
|
||||
m_first_activation = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -403,9 +403,9 @@ QWidget *ElementPropertiesWidget::generalWidget()
|
||||
|
||||
//button widget
|
||||
QPushButton *find_in_panel = new QPushButton(QET::Icons::ZoomDraw, tr("Retrouver dans le panel"), general_widget);
|
||||
connect(find_in_panel, SIGNAL(clicked()), this, SLOT(findInPanel()));
|
||||
connect(find_in_panel, &QPushButton::clicked, this, &ElementPropertiesWidget::findInPanel);
|
||||
QPushButton *edit_element = new QPushButton(QET::Icons::ElementEdit, tr("Éditer l'élément"), general_widget);
|
||||
connect(edit_element, SIGNAL(clicked()), this, SLOT(editElement()));
|
||||
connect(edit_element, &QPushButton::clicked, this, &ElementPropertiesWidget::editElement);
|
||||
QHBoxLayout *hlayout_ = new QHBoxLayout;
|
||||
hlayout_->addWidget(find_in_panel);
|
||||
hlayout_->addWidget(edit_element);
|
||||
|
||||
@@ -528,7 +528,7 @@ void LinkSingleElementWidget::diagramWasRemovedFromProject()
|
||||
// contains the master element linked to the edited element
|
||||
// we must wait for this elements to be unlinked,
|
||||
// or else the list of available master isn't up to date
|
||||
QTimer::singleShot(10, this, SLOT(updateUi()));
|
||||
QTimer::singleShot(10, this, &LinkSingleElementWidget::updateUi);
|
||||
}
|
||||
|
||||
void LinkSingleElementWidget::showedElementWasDeleted()
|
||||
@@ -717,8 +717,7 @@ void LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked(
|
||||
|
||||
if (m_showed_element)
|
||||
{
|
||||
disconnect(m_showed_element, SIGNAL(destroyed()),
|
||||
this, SLOT(showedElementWasDeleted()));
|
||||
disconnect(m_showed_element, &QObject::destroyed, this, &LinkSingleElementWidget::showedElementWasDeleted);
|
||||
m_showed_element->setHighlighted(false);
|
||||
}
|
||||
|
||||
@@ -726,8 +725,7 @@ void LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked(
|
||||
elmt->diagram()->showMe();
|
||||
elmt->setHighlighted(true);
|
||||
m_showed_element = elmt;
|
||||
connect(m_showed_element, SIGNAL(destroyed()),
|
||||
this, SLOT(showedElementWasDeleted()));
|
||||
connect(m_showed_element, &QObject::destroyed, this, &LinkSingleElementWidget::showedElementWasDeleted);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -154,14 +154,12 @@ void MasterPropertiesWidget::setElement(Element *element)
|
||||
m_element->setHighlighted(false);
|
||||
|
||||
if (m_project)
|
||||
disconnect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)),
|
||||
this, SLOT(diagramWasdeletedFromProject()));
|
||||
disconnect(m_project, &QETProject::diagramRemoved, this, &MasterPropertiesWidget::diagramWasdeletedFromProject);
|
||||
|
||||
if(Q_LIKELY(element->diagram() && element->diagram()->project()))
|
||||
{
|
||||
m_project = element->diagram()->project();
|
||||
connect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)),
|
||||
this, SLOT(diagramWasdeletedFromProject()));
|
||||
connect(m_project, &QETProject::diagramRemoved, this, &MasterPropertiesWidget::diagramWasdeletedFromProject);
|
||||
}
|
||||
else
|
||||
m_project = nullptr;
|
||||
@@ -397,8 +395,7 @@ void MasterPropertiesWidget::showElementFromTWI(QTreeWidgetItem *qtwi, int colum
|
||||
Q_UNUSED(column);
|
||||
if (m_showed_element)
|
||||
{
|
||||
disconnect(m_showed_element, SIGNAL(destroyed()),
|
||||
this, SLOT(showedElementWasDeleted()));
|
||||
disconnect(m_showed_element, &QObject::destroyed, this, &MasterPropertiesWidget::showedElementWasDeleted);
|
||||
m_showed_element -> setHighlighted(false);
|
||||
}
|
||||
if (m_element)
|
||||
@@ -407,8 +404,7 @@ void MasterPropertiesWidget::showElementFromTWI(QTreeWidgetItem *qtwi, int colum
|
||||
m_showed_element = m_qtwi_hash[qtwi];
|
||||
m_showed_element->diagram()->showMe();
|
||||
m_showed_element->setHighlighted(true);
|
||||
connect(m_showed_element, SIGNAL(destroyed()),
|
||||
this, SLOT(showedElementWasDeleted()));
|
||||
connect(m_showed_element, &QObject::destroyed, this, &MasterPropertiesWidget::showedElementWasDeleted);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,7 +427,7 @@ void MasterPropertiesWidget::diagramWasdeletedFromProject()
|
||||
// contains slave element linked to the edited element
|
||||
// we must wait for this elements be unlinked,
|
||||
// or else the linked list provides deleted elements.
|
||||
QTimer::singleShot(10, this, SLOT(updateUi()));
|
||||
QTimer::singleShot(10, this, &MasterPropertiesWidget::updateUi);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,9 +44,9 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *p
|
||||
|
||||
m_properties_dialog->addPage(new TerminalStripProjectConfigPage { project, parent });
|
||||
|
||||
connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString)));
|
||||
connect(projectAutoNumConfigPage,SIGNAL(saveCurrentTbp()),newDiagramPage,SLOT(saveCurrentTbp()));
|
||||
connect(projectAutoNumConfigPage,SIGNAL(loadSavedTbp()),newDiagramPage,SLOT(loadSavedTbp()));
|
||||
connect(projectAutoNumConfigPage, qOverload<QString>(&ProjectAutoNumConfigPage::setAutoNum), newDiagramPage, &NewDiagramPage::setFolioAutonum);
|
||||
connect(projectAutoNumConfigPage, &ProjectAutoNumConfigPage::saveCurrentTbp, newDiagramPage, &NewDiagramPage::saveCurrentTbp);
|
||||
connect(projectAutoNumConfigPage, &ProjectAutoNumConfigPage::loadSavedTbp, newDiagramPage, &NewDiagramPage::loadSavedTbp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -353,23 +353,23 @@ void TitleBlockPropertiesWidget::initDialog(
|
||||
this);
|
||||
|
||||
connect(m_tbt_edit,
|
||||
SIGNAL(triggered()),
|
||||
&QAction::triggered,
|
||||
this,
|
||||
SLOT(editCurrentTitleBlockTemplate()));
|
||||
&TitleBlockPropertiesWidget::editCurrentTitleBlockTemplate);
|
||||
connect(m_tbt_duplicate,
|
||||
SIGNAL(triggered()),
|
||||
&QAction::triggered,
|
||||
this,
|
||||
SLOT(duplicateCurrentTitleBlockTemplate()));
|
||||
&TitleBlockPropertiesWidget::duplicateCurrentTitleBlockTemplate);
|
||||
|
||||
m_tbt_menu = new QMenu(tr("Title block templates actions"), ui->m_tbt_pb);
|
||||
m_tbt_menu -> addAction(m_tbt_edit);
|
||||
m_tbt_menu -> addAction(m_tbt_duplicate);
|
||||
ui -> m_tbt_pb -> setMenu(m_tbt_menu);
|
||||
|
||||
connect(ui->m_tbt_cb,
|
||||
SIGNAL(currentIndexChanged(int)),
|
||||
this,
|
||||
SLOT(changeCurrentTitleBlockTemplate(int)));
|
||||
connect(ui->m_tbt_cb,
|
||||
qOverload<int>(&QComboBox::currentIndexChanged),
|
||||
this,
|
||||
&TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate);
|
||||
|
||||
if (project!= nullptr){
|
||||
keys_2 = project -> folioAutoNum().keys();
|
||||
|
||||
@@ -37,9 +37,9 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
|
||||
{
|
||||
ui->setupUi(this);
|
||||
buildUi();
|
||||
connect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool)));
|
||||
connect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()));
|
||||
connect(ui->m_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int)));
|
||||
connect(ui->m_display_has_cross_rb, &QRadioButton::toggled, ui->m_cross_properties_gb, &QWidget::setEnabled);
|
||||
connect(ui->m_type_cb, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::typeChanged);
|
||||
connect(ui->m_snap_to_cb, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::enableOffsetSB);
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
|
||||
*/
|
||||
XRefPropertiesWidget::~XRefPropertiesWidget()
|
||||
{
|
||||
disconnect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool)));
|
||||
disconnect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged()));
|
||||
disconnect(ui->m_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int)));
|
||||
disconnect(ui->m_display_has_cross_rb, &QRadioButton::toggled, ui->m_cross_properties_gb, &QWidget::setEnabled);
|
||||
disconnect(ui->m_type_cb, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::typeChanged);
|
||||
disconnect(ui->m_snap_to_cb, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::enableOffsetSB);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user