Update old fashioned SIGNAL/SLOT to point-to-member. Only simple and clear cases.

This commit is contained in:
Andre Rummler
2026-08-05 23:33:54 +02:00
parent 484ab9ed87
commit 62ad49a6d3
36 changed files with 182 additions and 238 deletions
+16 -32
View File
@@ -86,29 +86,21 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
//Disconnect previous project //Disconnect previous project
if (m_project && m_project_view) if (m_project && m_project_view)
{ {
//Conductor Signals disconnect(m_project, &QETProject::conductorAutoNumChanged, this, &AutoNumberingDockWidget::conductorAutoNumChanged);
disconnect(m_project, SIGNAL(conductorAutoNumChanged()), disconnect(m_project, &QETProject::conductorAutoNumRemoved, this, &AutoNumberingDockWidget::conductorAutoNumChanged);
this,SLOT(conductorAutoNumChanged())); disconnect(m_project, &QETProject::conductorAutoNumAdded, this, &AutoNumberingDockWidget::conductorAutoNumChanged);
disconnect (m_project,SIGNAL(conductorAutoNumRemoved()), disconnect(m_project_view, &ProjectView::diagramActivated, this, &AutoNumberingDockWidget::setConductorActive);
this,SLOT(conductorAutoNumChanged()));
disconnect (m_project,SIGNAL(conductorAutoNumAdded()),
this,SLOT(conductorAutoNumChanged()));
disconnect(m_project_view,SIGNAL(diagramActivated(DiagramView*)),
this,SLOT(setConductorActive(DiagramView*)));
//Element Signals //Element Signals
disconnect (m_project,SIGNAL(elementAutoNumRemoved(QString)), disconnect(m_project, &QETProject::elementAutoNumRemoved, this, &AutoNumberingDockWidget::elementAutoNumChanged);
this,SLOT(elementAutoNumChanged())); disconnect(m_project, &QETProject::elementAutoNumAdded, this, &AutoNumberingDockWidget::elementAutoNumChanged);
disconnect (m_project,SIGNAL(elementAutoNumAdded(QString)),
this,SLOT(elementAutoNumChanged()));
//Folio Signals //Folio Signals
disconnect (m_project,SIGNAL(folioAutoNumRemoved()), disconnect (m_project,SIGNAL(folioAutoNumRemoved()),
this,SLOT(folioAutoNumChanged())); this,SLOT(folioAutoNumChanged()));
disconnect (m_project,SIGNAL(folioAutoNumAdded()), disconnect (m_project,SIGNAL(folioAutoNumAdded()),
this,SLOT(folioAutoNumChanged())); this,SLOT(folioAutoNumChanged()));
disconnect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()), disconnect(m_project, &QETProject::defaultTitleBlockPropertiesChanged, this, &AutoNumberingDockWidget::setActive);
this,SLOT(setActive()));
//Conductor, Element and Folio Signals //Conductor, Element and Folio Signals
disconnect(m_project, &QETProject::autoNumContextUpdated, disconnect(m_project, &QETProject::autoNumContextUpdated,
@@ -121,29 +113,21 @@ void AutoNumberingDockWidget::setProject(QETProject *project,
m_project_view = projectview; m_project_view = projectview;
this->setEnabled(true); this->setEnabled(true);
//Conductor Signals connect(m_project, &QETProject::conductorAutoNumChanged, this, &AutoNumberingDockWidget::conductorAutoNumChanged);
connect(m_project, SIGNAL(conductorAutoNumChanged()), connect(m_project, &QETProject::conductorAutoNumRemoved, this, &AutoNumberingDockWidget::conductorAutoNumChanged);
this,SLOT(conductorAutoNumChanged())); connect(m_project, &QETProject::conductorAutoNumAdded, this, &AutoNumberingDockWidget::conductorAutoNumChanged);
connect(m_project,SIGNAL(conductorAutoNumRemoved()), connect(m_project_view, &ProjectView::diagramActivated, this, &AutoNumberingDockWidget::setConductorActive);
this,SLOT(conductorAutoNumChanged()));
connect(m_project,SIGNAL(conductorAutoNumAdded()),
this,SLOT(conductorAutoNumChanged()));
connect(m_project_view,SIGNAL(diagramActivated(DiagramView*)),
this,SLOT(setConductorActive(DiagramView*)));
//Element Signals //Element Signals
connect (m_project,SIGNAL(elementAutoNumRemoved(QString)), connect(m_project, &QETProject::elementAutoNumRemoved, this, &AutoNumberingDockWidget::elementAutoNumChanged);
this,SLOT(elementAutoNumChanged())); connect(m_project, &QETProject::elementAutoNumAdded, this, &AutoNumberingDockWidget::elementAutoNumChanged);
connect (m_project,SIGNAL(elementAutoNumAdded(QString)),
this,SLOT(elementAutoNumChanged()));
//Folio Signals //Folio Signals
connect (m_project,SIGNAL(folioAutoNumRemoved()), connect (m_project,SIGNAL(folioAutoNumRemoved()),
this,SLOT(folioAutoNumChanged())); this,SLOT(folioAutoNumChanged()));
connect (m_project,SIGNAL(folioAutoNumAdded()), connect (m_project,SIGNAL(folioAutoNumAdded()),
this,SLOT(folioAutoNumChanged())); this,SLOT(folioAutoNumChanged()));
connect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()), connect(m_project, &QETProject::defaultTitleBlockPropertiesChanged, this, &AutoNumberingDockWidget::setActive);
this,SLOT(setActive()));
//Conductor, Element and Folio Signals //Conductor, Element and Folio Signals
connect(m_project, &QETProject::autoNumContextUpdated, connect(m_project, &QETProject::autoNumContextUpdated,
+3 -4
View File
@@ -74,10 +74,9 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
setLayout(dialog_layout); setLayout(dialog_layout);
// connexion signaux / slots // connexion signaux / slots
connect(buttons, SIGNAL(accepted()), this, SLOT(applyConf())); connect(buttons, &QDialogButtonBox::accepted, this, &ConfigDialog::applyConf);
connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); connect(buttons, &QDialogButtonBox::rejected, this, &ConfigDialog::reject);
connect(pages_list, SIGNAL(currentRowChanged(int)), connect(pages_list, &QListWidget::currentRowChanged, pages_widget, &QStackedWidget::setCurrentIndex);
pages_widget, SLOT(setCurrentIndex(int)));
// set maximum a bit smaller than available size = (screen-size - Task-Bar): // set maximum a bit smaller than available size = (screen-size - Task-Bar):
setMaximumSize((int)(0.94 * MachineInfo::instance()->i_max_available_width()), setMaximumSize((int)(0.94 * MachineInfo::instance()->i_max_available_width()),
+1 -1
View File
@@ -99,7 +99,7 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
} }
connect(m_diagram, SIGNAL(showDiagram(Diagram*)), this, SIGNAL(showDiagram(Diagram*))); connect(m_diagram, SIGNAL(showDiagram(Diagram*)), this, SIGNAL(showDiagram(Diagram*)));
connect(m_diagram, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(adjustSceneRect())); connect(m_diagram, &QGraphicsScene::sceneRectChanged, this, &DiagramView::adjustSceneRect);
connect(&(m_diagram -> border_and_titleblock), &BorderTitleBlock::informationChanged, this, &DiagramView::updateWindowTitle); connect(&(m_diagram -> border_and_titleblock), &BorderTitleBlock::informationChanged, this, &DiagramView::updateWindowTitle);
connect(diagram, SIGNAL(findElementRequired(ElementsLocation)), this, SIGNAL(findElementRequired(ElementsLocation))); connect(diagram, SIGNAL(findElementRequired(ElementsLocation)), this, SIGNAL(findElementRequired(ElementsLocation)));
+6 -11
View File
@@ -69,10 +69,8 @@ ElementScene::ElementScene(QETElementEditor *editor, QObject *parent) :
initPasteArea(); initPasteArea();
m_undo_stack.setClean(); m_undo_stack.setClean();
m_decorator_lock = new QMutex(); m_decorator_lock = new QMutex();
connect(&m_undo_stack, SIGNAL(indexChanged(int)), connect(&m_undo_stack, &QUndoStack::indexChanged, this, &ElementScene::managePrimitivesGroups);
this, SLOT(managePrimitivesGroups())); connect(this, &ElementScene::selectionChanged, this, &ElementScene::managePrimitivesGroups);
connect(this, SIGNAL(selectionChanged()),
this, SLOT(managePrimitivesGroups()));
} }
/** /**
@@ -102,8 +100,7 @@ void ElementScene::setElementData(ElementData data)
ElementScene::~ElementScene() ElementScene::~ElementScene()
{ {
//Disconnect to avoid crash, see bug report N° 122. //Disconnect to avoid crash, see bug report N° 122.
disconnect(&m_undo_stack, SIGNAL(indexChanged(int)), disconnect(&m_undo_stack, &QUndoStack::indexChanged, this, &ElementScene::managePrimitivesGroups);
this, SLOT(managePrimitivesGroups()));
delete m_decorator_lock; delete m_decorator_lock;
if (m_event_interface) if (m_event_interface)
@@ -907,8 +904,8 @@ void ElementScene::slot_editAuthorInformations()
QDialogButtonBox::Ok QDialogButtonBox::Ok
| QDialogButtonBox::Cancel); | QDialogButtonBox::Cancel);
dialog_layout -> addWidget(dialog_buttons); dialog_layout -> addWidget(dialog_buttons);
connect(dialog_buttons, SIGNAL(accepted()),&dialog_author, SLOT(accept())); connect(dialog_buttons, &QDialogButtonBox::accepted, &dialog_author, &QDialog::accept);
connect(dialog_buttons, SIGNAL(rejected()),&dialog_author, SLOT(reject())); connect(dialog_buttons, &QDialogButtonBox::rejected, &dialog_author, &QDialog::reject);
// start the dialogue // start the dialogue
// lance le dialogue // lance le dialogue
@@ -1399,9 +1396,7 @@ void ElementScene::managePrimitivesGroups()
if (!m_decorator) if (!m_decorator)
{ {
m_decorator = new ElementPrimitiveDecorator(); m_decorator = new ElementPrimitiveDecorator();
connect(m_decorator, connect(m_decorator, &ElementPrimitiveDecorator::actionFinished, this, &ElementScene::stackAction);
SIGNAL(actionFinished(ElementEditionCommand*)),
this, SLOT(stackAction(ElementEditionCommand *)));
addItem(m_decorator); addItem(m_decorator);
m_decorator -> hide(); m_decorator -> hide();
} }
+2 -2
View File
@@ -37,8 +37,8 @@ ElementView::ElementView(ElementScene *scene, QWidget *parent) :
setResizeAnchor(QGraphicsView::AnchorUnderMouse); setResizeAnchor(QGraphicsView::AnchorUnderMouse);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
zoomReset(); zoomReset();
connect(m_scene, SIGNAL(pasteAreaDefined(const QRectF &)), this, SLOT(pasteAreaDefined(const QRectF &))); connect(m_scene, &ElementScene::pasteAreaDefined, this, &ElementView::pasteAreaDefined);
connect(m_scene, SIGNAL(needZoomFit()), this, SLOT(zoomFit())); connect(m_scene, &ElementScene::needZoomFit, this, &ElementView::zoomFit);
} }
/// Destructeur /// Destructeur
+2 -2
View File
@@ -51,9 +51,9 @@ PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent) :
adjustItemPosition(1); adjustItemPosition(1);
// adjust textfield position after line additions/deletions // adjust textfield position after line additions/deletions
connect(document(), connect(document(),
SIGNAL(blockCountChanged(int)), &QTextDocument::blockCountChanged,
this, this,
SLOT(adjustItemPosition(int))); &PartText::adjustItemPosition);
connect(document(), connect(document(),
SIGNAL(contentsChanged()), SIGNAL(contentsChanged()),
this, this,
@@ -222,7 +222,7 @@ void ElementPropertiesEditorWidget::setUpInterface()
ui->m_tree->setItemDelegate(new EditorDelegate(this)); ui->m_tree->setItemDelegate(new EditorDelegate(this));
// NEU: Checkbox mit der Zahlenbox verbinden (Aktivieren/Deaktivieren) // NEU: Checkbox mit der Zahlenbox verbinden (Aktivieren/Deaktivieren)
connect(ui->max_slaves_checkbox, SIGNAL(toggled(bool)), ui->max_slaves_spinbox, SLOT(setEnabled(bool))); connect(ui->max_slaves_checkbox, &QCheckBox::toggled, ui->max_slaves_spinbox, &QWidget::setEnabled);
connect(ui->max_slaves_spinbox, QOverload<int>::of(&QSpinBox::valueChanged), [this](int) { connect(ui->max_slaves_spinbox, QOverload<int>::of(&QSpinBox::valueChanged), [this](int) {
if (ui->m_slave_groups_checkbox->isChecked()) { if (ui->m_slave_groups_checkbox->isChecked()) {
populateSlaveGroupsTable(); populateSlaveGroupsTable();
+3 -3
View File
@@ -58,14 +58,14 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &location,
if (m_edit_mode) { if (m_edit_mode) {
setWindowTitle(tr("Éditer une catégorie", "window title")); setWindowTitle(tr("Éditer une catégorie", "window title"));
connect(m_buttons, SIGNAL(accepted()), this, SLOT(acceptUpdate())); connect(m_buttons, &QDialogButtonBox::accepted, this, &ElementsCategoryEditor::acceptUpdate);
m_names_list -> setNames(m_location.nameList()); m_names_list -> setNames(m_location.nameList());
m_file_line_edit -> setText(m_location.fileSystemPath()); m_file_line_edit -> setText(m_location.fileSystemPath());
m_file_line_edit -> setReadOnly(true); m_file_line_edit -> setReadOnly(true);
} else { } else {
setWindowTitle(tr("Créer une nouvelle catégorie", "window title")); setWindowTitle(tr("Créer une nouvelle catégorie", "window title"));
connect(m_buttons, SIGNAL(accepted()), this, SLOT(acceptCreation())); connect(m_buttons, &QDialogButtonBox::accepted, this, &ElementsCategoryEditor::acceptCreation);
NamesList cat_names; NamesList cat_names;
cat_names.addName(QLocale::system().name().left(2), tr("Nom de la nouvelle catégorie", "default name when creating a new category")); cat_names.addName(QLocale::system().name().left(2), tr("Nom de la nouvelle catégorie", "default name when creating a new category"));
@@ -114,7 +114,7 @@ void ElementsCategoryEditor::setUpWidget()
m_file_line_edit = new QFileNameEdit(); m_file_line_edit = new QFileNameEdit();
m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); m_buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject())); connect(m_buttons, &QDialogButtonBox::rejected, this, &ElementsCategoryEditor::reject);
QHBoxLayout *internal_name_layout = new QHBoxLayout(); QHBoxLayout *internal_name_layout = new QHBoxLayout();
internal_name_layout -> addWidget(m_file_name); internal_name_layout -> addWidget(m_file_name);
+1 -1
View File
@@ -117,7 +117,7 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
connect(filter_textfield, SIGNAL(textChanged(const QString &)), this, SLOT(filterEdited(const QString &))); connect(filter_textfield, SIGNAL(textChanged(const QString &)), this, SLOT(filterEdited(const QString &)));
connect(elements_panel, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(updateButtons())); connect(elements_panel, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(updateButtons()));
connect(elements_panel, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(handleContextMenu(const QPoint &))); connect(elements_panel, &ElementsPanel::customContextMenuRequested, this, &ElementsPanelWidget::handleContextMenu);
connect( connect(
elements_panel, elements_panel,
SIGNAL(requestForTitleBlockTemplate(const TitleBlockTemplateLocation &)), SIGNAL(requestForTitleBlockTemplate(const TitleBlockTemplateLocation &)),
+14 -14
View File
@@ -99,9 +99,9 @@ ExportDialog::ExportDialog(
// connexions signaux/slots // connexions signaux/slots
connect(epw, SIGNAL(formatChanged()), this, SLOT(slot_changeFilesExtension())); connect(epw, SIGNAL(formatChanged()), this, SLOT(slot_changeFilesExtension()));
connect(epw, SIGNAL(exportedAreaChanged()), this, SLOT(slot_changeUseBorder())); connect(epw, &ExportPropertiesWidget::exportedAreaChanged, this, &ExportDialog::slot_changeUseBorder);
connect(buttons, SIGNAL(accepted()), this, SLOT(slot_export())); connect(buttons, &QDialogButtonBox::accepted, this, &ExportDialog::slot_export);
connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); connect(buttons, &QDialogButtonBox::rejected, this, &ExportDialog::reject);
// ajustement des extensions des fichiers // ajustement des extensions des fichiers
slot_changeFilesExtension(true); slot_changeFilesExtension(true);
@@ -140,21 +140,21 @@ QWidget *ExportDialog::initDiagramsListPart()
reset_mapper_ = new QSignalMapper(this); reset_mapper_ = new QSignalMapper(this);
clipboard_mapper_ = new QSignalMapper(this); clipboard_mapper_ = new QSignalMapper(this);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available
connect(preview_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_previewDiagram);
connect(width_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctHeight);
connect(height_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctWidth);
connect(ratio_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_keepRatioChanged);
connect(reset_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_resetSize);
connect(clipboard_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_exportToClipBoard);
#else // TODO Qt6 only: remove, mappedInt() always available
connect(preview_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_previewDiagram(int))); connect(preview_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_previewDiagram(int)));
connect(width_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_correctHeight(int))); connect(width_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_correctHeight(int)));
connect(height_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_correctWidth(int))); connect(height_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_correctWidth(int)));
connect(ratio_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_keepRatioChanged(int))); connect(ratio_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_keepRatioChanged(int)));
connect(reset_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_resetSize(int))); connect(reset_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_resetSize(int)));
connect(clipboard_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_exportToClipBoard(int))); connect(clipboard_mapper_, SIGNAL(mapped(int)), this, SLOT(slot_exportToClipBoard(int)));
#endif #else
connect(preview_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_previewDiagram);
connect(width_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctHeight);
connect(height_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_correctWidth);
connect(ratio_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_keepRatioChanged);
connect(reset_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_resetSize);
connect(clipboard_mapper_, &QSignalMapper::mappedInt, this, &ExportDialog::slot_exportToClipBoard);
#endif
diagrams_list_layout_ = new QGridLayout(); diagrams_list_layout_ = new QGridLayout();
@@ -174,7 +174,7 @@ QWidget *ExportDialog::initDiagramsListPart()
diagrams_list_layout_ -> addLayout(diagram_line -> sizeLayout(), line_count, 3); diagrams_list_layout_ -> addLayout(diagram_line -> sizeLayout(), line_count, 3);
// si on decoche tous les schemas, on desactive le bouton "Exporter" // si on decoche tous les schemas, on desactive le bouton "Exporter"
connect(diagram_line -> must_export, SIGNAL(toggled(bool)), this, SLOT(slot_checkDiagramsCount())); connect(diagram_line -> must_export, &QCheckBox::toggled, this, &ExportDialog::slot_checkDiagramsCount);
// mappings et signaux pour la gestion des dimensions du schema // mappings et signaux pour la gestion des dimensions du schema
width_mapper_ -> setMapping(diagram_line -> width, line_count); width_mapper_ -> setMapping(diagram_line -> width, line_count);
@@ -939,7 +939,7 @@ void ExportDialog::slot_previewDiagram(int diagram_id) {
QGraphicsView *preview_view = new QGraphicsView(preview_scene); QGraphicsView *preview_view = new QGraphicsView(preview_scene);
preview_view -> setDragMode(QGraphicsView::ScrollHandDrag); preview_view -> setDragMode(QGraphicsView::ScrollHandDrag);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok); QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttons, SIGNAL(accepted()), &preview_dialog, SLOT(accept())); connect(buttons, &QDialogButtonBox::accepted, &preview_dialog, &QDialog::accept);
QVBoxLayout *vboxlayout1 = new QVBoxLayout(); QVBoxLayout *vboxlayout1 = new QVBoxLayout();
vboxlayout1 -> addWidget(preview_view); vboxlayout1 -> addWidget(preview_view);
+1 -1
View File
@@ -230,7 +230,7 @@ void ExportPropertiesWidget::build()
setTabOrder(draw_colored_conductors, draw_bg_transparent); setTabOrder(draw_colored_conductors, draw_bg_transparent);
// connexion du bouton permettant le choix du repertoire // connexion du bouton permettant le choix du repertoire
connect(button_browse, SIGNAL(released()), this, SLOT(slot_chooseADirectory())); connect(button_browse, &QPushButton::released, this, &ExportPropertiesWidget::slot_chooseADirectory);
// emission de signaux lors du changement de format et lors du changement de zone exportee // emission de signaux lors du changement de format et lors du changement de zone exportee
connect(format, SIGNAL(currentIndexChanged(int)), this, SIGNAL(formatChanged())); connect(format, SIGNAL(currentIndexChanged(int)), this, SIGNAL(formatChanged()));
+7 -7
View File
@@ -763,8 +763,8 @@ int ProjectView::cleanProject()
clean_dialog_layout -> addWidget(buttons); clean_dialog_layout -> addWidget(buttons);
clean_dialog.setLayout(clean_dialog_layout); clean_dialog.setLayout(clean_dialog_layout);
connect(buttons, SIGNAL(accepted()), &clean_dialog, SLOT(accept())); connect(buttons, &QDialogButtonBox::accepted, &clean_dialog, &QDialog::accept);
connect(buttons, SIGNAL(rejected()), &clean_dialog, SLOT(reject())); connect(buttons, &QDialogButtonBox::rejected, &clean_dialog, &QDialog::reject);
int clean_count = 0; int clean_count = 0;
if (clean_dialog.exec() == QDialog::Accepted) if (clean_dialog.exec() == QDialog::Accepted)
@@ -888,9 +888,9 @@ void ProjectView::initWidgets()
m_tab -> setCornerWidget(tabwidgetLeft, Qt::TopLeftCorner); m_tab -> setCornerWidget(tabwidgetLeft, Qt::TopLeftCorner);
// manage signals // manage signals
connect(m_tab, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int))); connect(m_tab, &QTabWidget::currentChanged, this, &ProjectView::tabChanged);
connect(m_tab, SIGNAL(tabBarDoubleClicked(int)), this, SLOT(tabDoubleClicked(int))); connect(m_tab, &QTabWidget::tabBarDoubleClicked, this, &ProjectView::tabDoubleClicked);
connect(m_tab->tabBar(), SIGNAL(tabMoved(int,int)), this, SLOT(tabMoved(int,int)), Qt::QueuedConnection); connect(m_tab->tabBar(), &QTabBar::tabMoved, this, &ProjectView::tabMoved, Qt::QueuedConnection);
fallback_widget_ -> setVisible(false); fallback_widget_ -> setVisible(false);
m_tab -> setVisible(false); m_tab -> setVisible(false);
@@ -1119,9 +1119,9 @@ void ProjectView::setDiagramPosition(Diagram *diagram, int new_position)
if (current_position < 0) if (current_position < 0)
return; return;
disconnect(m_tab->tabBar(), SIGNAL(tabMoved(int,int)), this, SLOT(tabMoved(int,int))); disconnect(m_tab->tabBar(), &QTabBar::tabMoved, this, &ProjectView::tabMoved);
m_tab->tabBar()->moveTab(current_position, new_position); m_tab->tabBar()->moveTab(current_position, new_position);
connect(m_tab->tabBar(), SIGNAL(tabMoved(int,int)), this, SLOT(tabMoved(int,int)), Qt::QueuedConnection); connect(m_tab->tabBar(), &QTabBar::tabMoved, this, &ProjectView::tabMoved, Qt::QueuedConnection);
rebuildDiagramsMap(); rebuildDiagramsMap();
+4 -4
View File
@@ -122,11 +122,11 @@ QETApp::QETApp() :
initSplashScreen(); initSplashScreen();
initSystemTray(); initSystemTray();
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedObject() always available
connect(&signal_map, &QSignalMapper::mappedObject, this, [this](QObject *object) { invertMainWindowVisibility(qobject_cast<QWidget *>(object)); });
#else // TODO Qt6 only: remove, mappedObject() always available
connect(&signal_map, SIGNAL(mapped(QWidget *)), this, SLOT(invertMainWindowVisibility(QWidget *))); connect(&signal_map, SIGNAL(mapped(QWidget *)), this, SLOT(invertMainWindowVisibility(QWidget *)));
#endif #else
connect(&signal_map, &QSignalMapper::mappedObject, this, [this](QObject *object) { invertMainWindowVisibility(qobject_cast<QWidget *>(object)); });
#endif
qApp->setQuitOnLastWindowClosed(false); qApp->setQuitOnLastWindowClosed(false);
connect(qApp, &QApplication::lastWindowClosed, connect(qApp, &QApplication::lastWindowClosed,
this, &QETApp::checkRemainingWindows); this, &QETApp::checkRemainingWindows);
+20 -33
View File
@@ -107,11 +107,11 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
m_workspace.setTabsClosable(true); m_workspace.setTabsClosable(true);
//Set the signal mapper //Set the signal mapper
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedObject() always available
connect(&windowMapper, &QSignalMapper::mappedObject, this, [this](QObject *object) { activateWidget(qobject_cast<QWidget *>(object)); });
#else // TODO Qt6 only: remove, mappedObject() always available
connect(&windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(activateWidget(QWidget *))); connect(&windowMapper, SIGNAL(mapped(QWidget *)), this, SLOT(activateWidget(QWidget *)));
#endif #else
connect(&windowMapper, &QSignalMapper::mappedObject, this, [this](QObject *object) { activateWidget(qobject_cast<QWidget *>(object)); });
#endif
setWindowTitle(tr("QElectroTech", "window title")); setWindowTitle(tr("QElectroTech", "window title"));
setWindowIcon(QET::Icons::QETLogo); setWindowIcon(QET::Icons::QETLogo);
@@ -133,14 +133,8 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
setMinimumSize(QSize(500, 350)); setMinimumSize(QSize(500, 350));
setWindowState(Qt::WindowMaximized); setWindowState(Qt::WindowMaximized);
connect (&m_workspace, connect(&m_workspace, &QMdiArea::subWindowActivated, this, &QETDiagramEditor::subWindowActivated);
SIGNAL(subWindowActivated(QMdiSubWindow *)), connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &QETDiagramEditor::slot_updatePasteAction);
this,
SLOT(subWindowActivated(QMdiSubWindow*)));
connect (QApplication::clipboard(),
SIGNAL(dataChanged()),
this,
SLOT(slot_updatePasteAction()));
readSettings(); readSettings();
show(); show();
@@ -188,16 +182,16 @@ void QETDiagramEditor::setUpElementsPanel()
connect(pa, SIGNAL(requestForProject (QETProject *)), this, SLOT(activateProject(QETProject *))); connect(pa, SIGNAL(requestForProject (QETProject *)), this, SLOT(activateProject(QETProject *)));
connect(pa, SIGNAL(requestForProjectClosing (QETProject *)), this, SLOT(closeProject(QETProject *))); connect(pa, SIGNAL(requestForProjectClosing (QETProject *)), this, SLOT(closeProject(QETProject *)));
connect(pa, SIGNAL(requestForProjectPropertiesEdition (QETProject *)), this, SLOT(editProjectProperties(QETProject *))); connect(pa, SIGNAL(requestForProjectPropertiesEdition (QETProject *)), this, SLOT(editProjectProperties(QETProject *)));
connect(pa, SIGNAL(requestForNewDiagram (QETProject *)), this, SLOT(addDiagramToProject(QETProject *))); 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 *)));
connect(pa, SIGNAL(requestForDiagramsDeletion (const QList<Diagram *> &)), this, SLOT(removeDiagrams(const QList<Diagram *> &))); connect(pa, &ElementsPanelWidget::requestForDiagramsDeletion, this, &QETDiagramEditor::removeDiagrams);
connect(pa, SIGNAL(requestForDiagramMoveUp (const QList<Diagram *> &)), this, SLOT(moveDiagramUp(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveUp, this, &QETDiagramEditor::moveDiagramUp);
connect(pa, SIGNAL(requestForDiagramMoveDown (const QList<Diagram *> &)), this, SLOT(moveDiagramDown(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveDown, this, &QETDiagramEditor::moveDiagramDown);
connect(pa, SIGNAL(requestForDiagramMoveUpTop (const QList<Diagram *> &)), this, SLOT(moveDiagramUpTop(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveUpTop, this, &QETDiagramEditor::moveDiagramUpTop);
connect(pa, SIGNAL(requestForDiagramMoveUpx10 (const QList<Diagram *> &)), this, SLOT(moveDiagramUpx10(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveUpx10, this, &QETDiagramEditor::moveDiagramUpx10);
connect(pa, SIGNAL(requestForDiagramMoveDownx10 (const QList<Diagram *> &)), this, SLOT(moveDiagramDownx10(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveDownx10, this, &QETDiagramEditor::moveDiagramDownx10);
connect(pa, SIGNAL(requestForDiagramMoveUpx100 (const QList<Diagram *> &)), this, SLOT(moveDiagramUpx100(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveUpx100, this, &QETDiagramEditor::moveDiagramUpx100);
connect(pa, SIGNAL(requestForDiagramMoveDownx100 (const QList<Diagram *> &)), this, SLOT(moveDiagramDownx100(const QList<Diagram *>&))); connect(pa, &ElementsPanelWidget::requestForDiagramMoveDownx100, this, &QETDiagramEditor::moveDiagramDownx100);
} }
/** /**
@@ -850,8 +844,7 @@ void QETDiagramEditor::setUpMenu()
// File menu // File menu
QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts")); QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions()); recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions());
connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), connect(QETApp::projectsRecentFiles(), &RecentFiles::fileOpeningRequested, this, &QETDiagramEditor::openRecentFile);
this, SLOT(openRecentFile(const QString &)));
menu_fichier -> addActions(m_file_actions_group.actions()); menu_fichier -> addActions(m_file_actions_group.actions());
menu_fichier -> addSeparator(); menu_fichier -> addSeparator();
//menu_fichier -> addAction(import_diagram); //menu_fichier -> addAction(import_diagram);
@@ -1928,15 +1921,12 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view)
diagramWasAdded(dv); diagramWasAdded(dv);
//Manage the close event of project //Manage the close event of project
connect(project_view, SIGNAL(projectClosed(ProjectView*)), connect(project_view, &ProjectView::projectClosed, this, &QETDiagramEditor::projectWasClosed);
this, SLOT(projectWasClosed(ProjectView *)));
//Manage the adding of diagram //Manage the adding of diagram
connect(project_view, SIGNAL(diagramAdded(DiagramView *)), connect(project_view, &ProjectView::diagramAdded, this, &QETDiagramEditor::diagramWasAdded);
this, SLOT(diagramWasAdded(DiagramView *)));
if (QETProject *project = project_view -> project()) if (QETProject *project = project_view -> project())
connect(project, SIGNAL(readOnlyChanged(QETProject *, bool)), connect(project, &QETProject::readOnlyChanged, this, &QETDiagramEditor::slot_updateActions);
this, SLOT(slot_updateActions()));
//Manage request for edit or find element and titleblock //Manage request for edit or find element and titleblock
connect (project_view, &ProjectView::findElementRequired, connect (project_view, &ProjectView::findElementRequired,
@@ -2510,10 +2500,7 @@ void QETDiagramEditor::diagramWasAdded(DiagramView *dv)
this, this,
&QETDiagramEditor::selectionChanged, &QETDiagramEditor::selectionChanged,
Qt::DirectConnection); Qt::DirectConnection);
connect(dv, connect(dv, &DiagramView::modeChanged, this, &QETDiagramEditor::slot_updateModeActions);
SIGNAL(modeChanged()),
this,
SLOT(slot_updateModeActions()));
} }
/** /**
+2 -4
View File
@@ -113,10 +113,8 @@ void CrossRefItem::setUpConnection()
set=true; set=true;
else if(m_properties.snapTo() == XRefProperties::Bottom && !m_text && !m_group) //Snap to bottom of element and parent is the element itself else if(m_properties.snapTo() == XRefProperties::Bottom && !m_text && !m_group) //Snap to bottom of element and parent is the element itself
{ {
m_update_connection << connect(m_element, SIGNAL(yChanged()), m_update_connection << connect(m_element, &Element::yChanged, this, &CrossRefItem::autoPos);
this, SLOT(autoPos())); m_update_connection << connect(m_element, &Element::rotationChanged, this, &CrossRefItem::autoPos);
m_update_connection << connect(m_element, SIGNAL(rotationChanged()),
this, SLOT(autoPos()));
set=true; set=true;
} }
+1 -1
View File
@@ -146,7 +146,7 @@ void QETMainWindow::initCommonMenus()
settings_menu_ = new QMenu(tr("&Configuration", "window menu"), this); settings_menu_ = new QMenu(tr("&Configuration", "window menu"), this);
settings_menu_ -> addAction(fullscreen_action_); settings_menu_ -> addAction(fullscreen_action_);
settings_menu_ -> addAction(configure_action_); settings_menu_ -> addAction(configure_action_);
connect(settings_menu_, SIGNAL(aboutToShow()), this, SLOT(checkToolbarsmenu())); connect(settings_menu_, &QMenu::aboutToShow, this, &QETMainWindow::checkToolbarsmenu);
help_menu_ = new QMenu(tr("&Aide", "window menu"), this); help_menu_ = new QMenu(tr("&Aide", "window menu"), this);
help_menu_ -> addAction(whatsthis_action_); help_menu_ -> addAction(whatsthis_action_);
+1 -1
View File
@@ -199,7 +199,7 @@ void QETProject::init()
connect(&m_titleblocks_collection, &TitleBlockTemplatesCollection::aboutToRemove, this, &QETProject::removeDiagramsTitleBlockTemplate); connect(&m_titleblocks_collection, &TitleBlockTemplatesCollection::aboutToRemove, this, &QETProject::removeDiagramsTitleBlockTemplate);
m_undo_stack = new QUndoStack(this); m_undo_stack = new QUndoStack(this);
connect(m_undo_stack, SIGNAL(cleanChanged(bool)), this, SLOT(undoStackChanged(bool))); connect(m_undo_stack, &QUndoStack::cleanChanged, this, &QETProject::undoStackChanged);
m_save_backup_timer.setInterval(BACKUP_INTERVAL); m_save_backup_timer.setInterval(BACKUP_INTERVAL);
connect(&m_save_backup_timer, &QTimer::timeout, this, &QETProject::writeBackup); connect(&m_save_backup_timer, &QTimer::timeout, this, &QETProject::writeBackup);
+1 -1
View File
@@ -82,7 +82,7 @@ void QFileNameEdit::init()
"tooltip content when editing a filename" "tooltip content when editing a filename"
) )
); );
connect(validator_, SIGNAL(validationFailed()), this, SLOT(validationFailed())); connect(validator_, &QETRegExpValidator::validationFailed, this, &QFileNameEdit::validationFailed);
} }
/** /**
+3 -4
View File
@@ -122,9 +122,9 @@ void QTextOrientationSpinBoxWidget::build()
orientation_widget_, orientation_widget_,
SLOT(setOrientation(double))); SLOT(setOrientation(double)));
connect(orientation_widget_, connect(orientation_widget_,
SIGNAL(orientationChanged(double)), &QTextOrientationWidget::orientationChanged,
spin_box_, spin_box_,
SLOT(setValue(double))); &QDoubleSpinBox::setValue);
// cliquer sur un des carres du QTextOrientationWidget revient a finir une saisie dans le SpinBox // cliquer sur un des carres du QTextOrientationWidget revient a finir une saisie dans le SpinBox
connect(orientation_widget_, connect(orientation_widget_,
@@ -134,8 +134,7 @@ void QTextOrientationSpinBoxWidget::build()
// lorsque l'utilisateur a change l'orientation, // lorsque l'utilisateur a change l'orientation,
// on emet un signal avec la valeur de la nouvelle orientation // on emet un signal avec la valeur de la nouvelle orientation
connect(spin_box_, SIGNAL(editingFinished()), connect(spin_box_, &QDoubleSpinBox::editingFinished, this, &QTextOrientationSpinBoxWidget::emitChangeSignals);
this, SLOT(emitChangeSignals()));
// dispose les widgets : le QTextOrientationWidget a gauche, le SpinBox a droite // dispose les widgets : le QTextOrientationWidget a gauche, le SpinBox a droite
QHBoxLayout *main_layout = new QHBoxLayout(); QHBoxLayout *main_layout = new QHBoxLayout();
+6 -9
View File
@@ -540,8 +540,7 @@ RichTextEditorToolBar::RichTextEditorToolBar(RichTextEditor *editor,
addSeparator(); addSeparator();
// Text color button // Text color button
connect(m_color_action, SIGNAL(colorChanged(QColor)), connect(m_color_action, &ColorAction::colorChanged, this, &RichTextEditorToolBar::colorChanged);
this, SLOT(colorChanged(QColor)));
addAction(m_color_action); addAction(m_color_action);
@@ -550,8 +549,7 @@ RichTextEditorToolBar::RichTextEditorToolBar(RichTextEditor *editor,
QIcon(":/ico/32x32/simplifyrichtext.png"), QIcon(":/ico/32x32/simplifyrichtext.png"),
tr("Simplify Rich Text"), editor, SLOT(setSimplifyRichText(bool)),this); tr("Simplify Rich Text"), editor, SLOT(setSimplifyRichText(bool)),this);
m_simplify_richtext_action->setChecked(editor->simplifyRichText()); m_simplify_richtext_action->setChecked(editor->simplifyRichText());
connect(m_editor, SIGNAL(simplifyRichTextChanged(bool)), connect(m_editor, &RichTextEditor::simplifyRichTextChanged, m_simplify_richtext_action, &QAction::setChecked);
m_simplify_richtext_action, SLOT(setChecked(bool)));
addAction(m_simplify_richtext_action); addAction(m_simplify_richtext_action);
connect(editor, SIGNAL(textChanged()), this, SLOT(updateActions())); connect(editor, SIGNAL(textChanged()), this, SLOT(updateActions()));
@@ -779,7 +777,7 @@ RichTextEditorDialog::RichTextEditorDialog(QWidget *parent) :
m_text_edit->setAcceptRichText(false); m_text_edit->setAcceptRichText(false);
connect(m_editor, SIGNAL(textChanged()), this, SLOT(richTextChanged())); connect(m_editor, SIGNAL(textChanged()), this, SLOT(richTextChanged()));
connect(m_editor, SIGNAL(simplifyRichTextChanged(bool)), this, SLOT(richTextChanged())); connect(m_editor, &RichTextEditor::simplifyRichTextChanged, this, &RichTextEditorDialog::richTextChanged);
connect(m_text_edit, SIGNAL(textChanged()), this, SLOT(sourceChanged())); connect(m_text_edit, SIGNAL(textChanged()), this, SLOT(sourceChanged()));
// The toolbar needs to be created after the RichTextEditor // The toolbar needs to be created after the RichTextEditor
@@ -798,16 +796,15 @@ RichTextEditorDialog::RichTextEditorDialog(QWidget *parent) :
m_tab_widget->setTabPosition(QTabWidget::South); m_tab_widget->setTabPosition(QTabWidget::South);
m_tab_widget->addTab(rich_edit, tr("Rich Text")); m_tab_widget->addTab(rich_edit, tr("Rich Text"));
m_tab_widget->addTab(plain_edit, tr("Source")); m_tab_widget->addTab(plain_edit, tr("Source"));
connect(m_tab_widget, SIGNAL(currentChanged(int)), connect(m_tab_widget, &QTabWidget::currentChanged, this, &RichTextEditorDialog::tabIndexChanged);
SLOT(tabIndexChanged(int)));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
QPushButton *ok_button = buttonBox->button(QDialogButtonBox::Ok); QPushButton *ok_button = buttonBox->button(QDialogButtonBox::Ok);
ok_button->setText(tr("&OK")); ok_button->setText(tr("&OK"));
ok_button->setDefault(true); ok_button->setDefault(true);
buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("&Cancel")); buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("&Cancel"));
connect(buttonBox, SIGNAL(accepted()), this, SLOT(on_buttonBox_accepted())); connect(buttonBox, &QDialogButtonBox::accepted, this, &RichTextEditorDialog::on_buttonBox_accepted);
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, this, &RichTextEditorDialog::reject);
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(m_tab_widget); layout->addWidget(m_tab_widget);
+2 -2
View File
@@ -150,8 +150,8 @@ void TitleBlockDimensionWidget::initWidgets()
// buttons, for the user to validate its input // buttons, for the user to validate its input
buttons_ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); buttons_ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttons_, SIGNAL(accepted()), this, SLOT(accept())); connect(buttons_, &QDialogButtonBox::accepted, this, &TitleBlockDimensionWidget::accept);
connect(buttons_, SIGNAL(rejected()), this, SLOT(reject())); connect(buttons_, &QDialogButtonBox::rejected, this, &TitleBlockDimensionWidget::reject);
} }
/** /**
@@ -226,10 +226,10 @@ void IntegrationMoveTitleBlockTemplatesHandler::initDialog()
dialog_vlayout_ -> addLayout(dialog_glayout); dialog_vlayout_ -> addLayout(dialog_glayout);
dialog_vlayout_ -> addWidget(buttons_); dialog_vlayout_ -> addWidget(buttons_);
connect(use_existing_template_, SIGNAL(toggled(bool)), this, SLOT(correctRadioButtons())); connect(use_existing_template_, &QRadioButton::toggled, this, &IntegrationMoveTitleBlockTemplatesHandler::correctRadioButtons);
connect(integrate_new_template_, SIGNAL(toggled(bool)), this, SLOT(correctRadioButtons())); connect(integrate_new_template_, &QRadioButton::toggled, this, &IntegrationMoveTitleBlockTemplatesHandler::correctRadioButtons);
connect(buttons_, SIGNAL(accepted()), integ_dialog_, SLOT(accept())); connect(buttons_, &QDialogButtonBox::accepted, integ_dialog_, &QDialog::accept);
connect(buttons_, SIGNAL(rejected()), integ_dialog_, SLOT(reject())); connect(buttons_, &QDialogButtonBox::rejected, integ_dialog_, &QDialog::reject);
} }
/** /**
+21 -21
View File
@@ -342,7 +342,7 @@ void QETTitleBlockTemplateEditor::editLogos()
QDialog d(this); QDialog d(this);
d.setWindowTitle(logo_manager_ -> windowTitle()); d.setWindowTitle(logo_manager_ -> windowTitle());
d.setLayout(vlayout0); d.setLayout(vlayout0);
connect(buttons, SIGNAL(rejected()), &d, SLOT(reject())); connect(buttons, &QDialogButtonBox::rejected, &d, &QDialog::reject);
d.exec(); d.exec();
// prevent the logo manager from being deleted along with the dialog // prevent the logo manager from being deleted along with the dialog
@@ -554,34 +554,36 @@ void QETTitleBlockTemplateEditor::initWidgets()
connect( connect(
template_edition_area_view_, template_edition_area_view_,
SIGNAL(selectedCellsChanged(QList<TitleBlockCell *>)), &TitleBlockTemplateView::selectedCellsChanged,
this, this,
SLOT(selectedCellsChanged(QList<TitleBlockCell *>)) &QETTitleBlockTemplateEditor::selectedCellsChanged
); );
connect(template_cell_editor_widget_, SIGNAL(logoEditionRequested()),
this, SLOT(editLogos()));
connect( connect(
template_cell_editor_widget_, template_cell_editor_widget_,
SIGNAL(cellModified(ModifyTitleBlockCellCommand *)), &TitleBlockTemplateCellWidget::logoEditionRequested,
this, this,
SLOT(pushCellUndoCommand(ModifyTitleBlockCellCommand *)) &QETTitleBlockTemplateEditor::editLogos
);
connect(
template_cell_editor_widget_,
&TitleBlockTemplateCellWidget::cellModified,
this,
&QETTitleBlockTemplateEditor::pushCellUndoCommand
); );
connect( connect(
template_edition_area_view_, template_edition_area_view_,
SIGNAL(gridModificationRequested(TitleBlockTemplateCommand *)), &TitleBlockTemplateView::gridModificationRequested,
this, this,
SLOT(pushGridUndoCommand(TitleBlockTemplateCommand *)) &QETTitleBlockTemplateEditor::pushGridUndoCommand
); );
connect( connect(
template_edition_area_view_, template_edition_area_view_,
SIGNAL(previewWidthChanged(int,int)), &TitleBlockTemplateView::previewWidthChanged,
this, this,
SLOT(savePreviewWidthToApplicationSettings(int, int)) &QETTitleBlockTemplateEditor::savePreviewWidthToApplicationSettings
); );
connect(undo_stack_, SIGNAL(cleanChanged(bool)), connect(undo_stack_, &QUndoStack::cleanChanged, this, &QETTitleBlockTemplateEditor::updateEditorTitle);
this, SLOT(updateEditorTitle())); connect(QApplication::clipboard(), &QClipboard::dataChanged, this, &QETTitleBlockTemplateEditor::updateActions);
connect(QApplication::clipboard(), SIGNAL(dataChanged()),
this, SLOT(updateActions()));
} }
/** /**
@@ -960,8 +962,8 @@ TitleBlockTemplateLocation QETTitleBlockTemplateEditor::getTitleBlockTemplateLoc
dialog.setWindowTitle(title); dialog.setWindowTitle(title);
dialog.setLayout(dialog_layout); dialog.setLayout(dialog_layout);
connect(buttons, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
connect(buttons, SIGNAL(rejected()), &dialog, SLOT(reject())); connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
return(widget -> location()); return(widget -> location());
@@ -1027,10 +1029,8 @@ void QETTitleBlockTemplateEditor::editTemplateInformation()
: QDialogButtonBox::Ok : QDialogButtonBox::Ok
| QDialogButtonBox::Cancel); | QDialogButtonBox::Cancel);
dialog_layout -> addWidget(dialog_buttons); dialog_layout -> addWidget(dialog_buttons);
connect(dialog_buttons, SIGNAL(accepted()), connect(dialog_buttons, &QDialogButtonBox::accepted, &dialog_author, &QDialog::accept);
&dialog_author, SLOT(accept())); connect(dialog_buttons, &QDialogButtonBox::rejected, &dialog_author, &QDialog::reject);
connect(dialog_buttons, SIGNAL(rejected()),
&dialog_author, SLOT(reject()));
// run the dialog // run the dialog
if (dialog_author.exec() == QDialog::Accepted && !read_only_) { if (dialog_author.exec() == QDialog::Accepted && !read_only_) {
+3 -3
View File
@@ -150,10 +150,10 @@ void TitleBlockTemplateCellWidget::initWidgets()
// handle cell modifications // handle cell modifications
connect(cell_type_input_, SIGNAL(activated(int)), this, SLOT(updateFormType(int))); connect(cell_type_input_, SIGNAL(activated(int)), this, SLOT(updateFormType(int)));
connect(cell_type_input_, SIGNAL(activated(int)), this, SLOT(editType())); connect(cell_type_input_, SIGNAL(activated(int)), this, SLOT(editType()));
connect(name_input_, SIGNAL(editingFinished()), this, SLOT(editName())); connect(name_input_, &QLineEdit::editingFinished, this, &TitleBlockTemplateCellWidget::editName);
connect(label_checkbox_, SIGNAL(clicked(bool)), this, SLOT(editLabelDisplayed())); connect(label_checkbox_, SIGNAL(clicked(bool)), this, SLOT(editLabelDisplayed()));
connect(label_edit_, SIGNAL(released()), this, SLOT(editLabel())); connect(label_edit_, &QPushButton::released, this, &TitleBlockTemplateCellWidget::editLabel);
connect(value_edit_, SIGNAL(released()), this, SLOT(editValue())); connect(value_edit_, &QPushButton::released, this, &TitleBlockTemplateCellWidget::editValue);
connect(horiz_align_input_, SIGNAL(activated(int)), this, SLOT(editAlignment())); connect(horiz_align_input_, SIGNAL(activated(int)), this, SLOT(editAlignment()));
connect(vert_align_input_, SIGNAL(activated(int)), this, SLOT(editAlignment())); connect(vert_align_input_, SIGNAL(activated(int)), this, SLOT(editAlignment()));
connect(font_size_input_, SIGNAL(valueChanged(int)), this, SLOT(editFontSize())); connect(font_size_input_, SIGNAL(valueChanged(int)), this, SLOT(editFontSize()));
+9 -8
View File
@@ -129,10 +129,10 @@ void TitleBlockTemplateLogoManager::initWidgets()
this, this,
SLOT(updateLogoInformations(QListWidgetItem *, QListWidgetItem *)) SLOT(updateLogoInformations(QListWidgetItem *, QListWidgetItem *))
); );
connect(add_button_, SIGNAL(released()), this, SLOT(addLogo())); connect(add_button_, &QPushButton::released, this, &TitleBlockTemplateLogoManager::addLogo);
connect(export_button_, SIGNAL(released()), this, SLOT(exportLogo())); connect(export_button_, &QPushButton::released, this, &TitleBlockTemplateLogoManager::exportLogo);
connect(delete_button_, SIGNAL(released()), this, SLOT(removeLogo())); connect(delete_button_, &QPushButton::released, this, &TitleBlockTemplateLogoManager::removeLogo);
connect(rename_button_, SIGNAL(released()), this, SLOT(renameLogo())); connect(rename_button_, &QPushButton::released, this, &TitleBlockTemplateLogoManager::renameLogo);
} }
/** /**
@@ -217,11 +217,12 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na
connect(replace_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); connect(replace_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
connect(rename_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); connect(rename_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
connect(cancel_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); connect(cancel_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available
connect(signal_mapper, &QSignalMapper::mappedInt, rename_dialog, &QDialog::done);
#else // TOD Qt6 only: remove, mappedInt() always available
connect(signal_mapper, SIGNAL(mapped(int)), rename_dialog, SLOT(done(int))); connect(signal_mapper, SIGNAL(mapped(int)), rename_dialog, SLOT(done(int)));
#endif
#else
connect(signal_mapper, &QSignalMapper::mappedInt, rename_dialog, &QDialog::done);
#endif
} }
rd_label -> setText( rd_label -> setText(
QString(tr( QString(tr(
+1 -1
View File
@@ -383,7 +383,7 @@ TitleBlockTemplatesFilesCollection::TitleBlockTemplatesFilesCollection(const QSt
if (dir_.exists()) { if (dir_.exists()) {
watcher_.addPath(dir_.canonicalPath()); watcher_.addPath(dir_.canonicalPath());
} }
connect(&watcher_, SIGNAL(directoryChanged(const QString &)), this, SLOT(fileSystemChanged(const QString &))); connect(&watcher_, &QFileSystemWatcher::directoryChanged, this, &TitleBlockTemplatesFilesCollection::fileSystemChanged);
} }
/** /**
+8 -14
View File
@@ -597,7 +597,7 @@ void TitleBlockTemplateView::init()
setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setBackgroundBrush(QBrush(QColor(248, 255, 160))); setBackgroundBrush(QBrush(QColor(248, 255, 160)));
connect(scene(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); connect(scene(), &QGraphicsScene::selectionChanged, this, &TitleBlockTemplateView::selectionChanged);
} }
/** /**
@@ -626,7 +626,7 @@ void TitleBlockTemplateView::applyColumnsWidths(bool animate) {
animation -> setStartValue(QVariant(tbgrid_ -> columnMinimumWidth(COL_OFFSET + i))); animation -> setStartValue(QVariant(tbgrid_ -> columnMinimumWidth(COL_OFFSET + i)));
animation -> setEndValue(QVariant(1.0 * applied_width)); animation -> setEndValue(QVariant(1.0 * applied_width));
animation -> setDuration(500); animation -> setDuration(500);
connect(animation, SIGNAL(finished()), this, SLOT(updateColumnsHelperCells())); connect(animation, &GridLayoutAnimation::finished, this, &TitleBlockTemplateView::updateColumnsHelperCells);
animation -> start(QAbstractAnimation::DeleteWhenStopped); animation -> start(QAbstractAnimation::DeleteWhenStopped);
} }
total_applied_width += applied_width; total_applied_width += applied_width;
@@ -747,10 +747,8 @@ void TitleBlockTemplateView::addCells()
updateTotalWidthLabel(); updateTotalWidthLabel();
total_width_helper_cell_ -> orientation = Qt::Horizontal; total_width_helper_cell_ -> orientation = Qt::Horizontal;
total_width_helper_cell_ -> setActions(QList<QAction *>() << change_preview_width_); total_width_helper_cell_ -> setActions(QList<QAction *>() << change_preview_width_);
connect(total_width_helper_cell_, SIGNAL(contextMenuTriggered(HelperCell *)), connect(total_width_helper_cell_, &HelperCell::contextMenuTriggered, this, &TitleBlockTemplateView::updateLastContextMenuCell);
this, SLOT(updateLastContextMenuCell(HelperCell *))); connect(total_width_helper_cell_, &HelperCell::doubleClicked, this, &TitleBlockTemplateView::changePreviewWidth);
connect(total_width_helper_cell_, SIGNAL(doubleClicked(HelperCell*)),
this, SLOT(changePreviewWidth()));
tbgrid_ -> addItem(total_width_helper_cell_, 0, COL_OFFSET, 1, col_count); tbgrid_ -> addItem(total_width_helper_cell_, 0, COL_OFFSET, 1, col_count);
// we also initialize an extra helper cells that shows the preview width is // we also initialize an extra helper cells that shows the preview width is
@@ -767,10 +765,8 @@ void TitleBlockTemplateView::addCells()
current_col_cell -> setActions(columnsActions()); current_col_cell -> setActions(columnsActions());
current_col_cell -> orientation = Qt::Horizontal; current_col_cell -> orientation = Qt::Horizontal;
current_col_cell -> index = i; current_col_cell -> index = i;
connect(current_col_cell, SIGNAL(contextMenuTriggered(HelperCell *)), connect(current_col_cell, &HelperCell::contextMenuTriggered, this, &TitleBlockTemplateView::updateLastContextMenuCell);
this, SLOT(updateLastContextMenuCell(HelperCell *))); connect(current_col_cell, &HelperCell::doubleClicked, this, &TitleBlockTemplateView::editColumn);
connect(current_col_cell, SIGNAL(doubleClicked(HelperCell*)),
this, SLOT(editColumn(HelperCell *)));
tbgrid_ -> addItem(current_col_cell, 1, COL_OFFSET + i, 1, 1); tbgrid_ -> addItem(current_col_cell, 1, COL_OFFSET + i, 1, 1);
} }
@@ -783,10 +779,8 @@ void TitleBlockTemplateView::addCells()
current_row_cell -> orientation = Qt::Vertical; current_row_cell -> orientation = Qt::Vertical;
current_row_cell -> index = i; current_row_cell -> index = i;
current_row_cell -> setActions(rowsActions()); current_row_cell -> setActions(rowsActions());
connect(current_row_cell, SIGNAL(contextMenuTriggered(HelperCell *)), connect(current_row_cell, &HelperCell::contextMenuTriggered, this, &TitleBlockTemplateView::updateLastContextMenuCell);
this, SLOT(updateLastContextMenuCell(HelperCell *))); connect(current_row_cell, &HelperCell::doubleClicked, this, &TitleBlockTemplateView::editRow);
connect(current_row_cell, SIGNAL(doubleClicked(HelperCell*)),
this, SLOT(editRow(HelperCell *)));
tbgrid_ -> addItem(current_row_cell, ROW_OFFSET + i, 0, 1, 1); tbgrid_ -> addItem(current_row_cell, ROW_OFFSET + i, 0, 1, 1);
} }
+2 -2
View File
@@ -110,7 +110,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project,
xrefpw -> setProperties (m_project -> defaultXRefProperties()); xrefpw -> setProperties (m_project -> defaultXRefProperties());
} }
connect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab())); connect(ipw, &TitleBlockPropertiesWidget::openAutoNumFolioEditor, this, &NewDiagramPage::changeToAutoFolioTab);
// main tab widget // main tab widget
QTabWidget *tab_widget = new QTabWidget(this); QTabWidget *tab_widget = new QTabWidget(this);
@@ -138,7 +138,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project,
*/ */
NewDiagramPage::~NewDiagramPage() NewDiagramPage::~NewDiagramPage()
{ {
disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab())); disconnect(ipw, &TitleBlockPropertiesWidget::openAutoNumFolioEditor, this, &NewDiagramPage::changeToAutoFolioTab);
} }
/** /**
+14 -14
View File
@@ -391,37 +391,37 @@ void ProjectAutoNumConfigPage::adjustReadOnly()
void ProjectAutoNumConfigPage::buildConnections() void ProjectAutoNumConfigPage::buildConnections()
{ {
//Management Tab //Management Tab
connect (m_amw, SIGNAL(applyPressed()), this, SLOT(applyManagement())); connect(m_amw, &AutoNumberingManagementW::applyPressed, this, &ProjectAutoNumConfigPage::applyManagement);
//Conductor Tab //Conductor Tab
connect(m_saw_conductor, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextConductor); connect(m_saw_conductor, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextConductor);
connect(m_saw_conductor, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextConductor); connect(m_saw_conductor, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextConductor);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available
connect(m_saw_conductor->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextConductor);
#else // TODO Qt6 only: remove, textActivated() always available
connect(m_saw_conductor->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextConductor(QString))); connect(m_saw_conductor->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextConductor(QString)));
#endif #else
connect(m_saw_conductor->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextConductor);
#endif
//Element Tab //Element Tab
connect(m_saw_element, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextElement); connect(m_saw_element, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextElement);
connect(m_saw_element, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextElement); connect(m_saw_element, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextElement);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available
connect(m_saw_element->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextElement);
#else // TODO Qt6 only: remove, textActivated() always available
connect(m_saw_element->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextElement(QString))); connect(m_saw_element->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextElement(QString)));
#endif #else
connect(m_saw_element->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextElement);
#endif
//Folio Tab //Folio Tab
connect(m_saw_folio, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextFolio); connect(m_saw_folio, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextFolio);
connect(m_saw_folio, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextFolio); connect(m_saw_folio, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextFolio);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // TODO Qt6 only: remove, textActivated() always available
connect(m_saw_folio->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextFolio);
#else // TODO Qt6 only: remove, textActivated() always available
connect(m_saw_folio->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextFolio(QString))); connect(m_saw_folio->contextComboBox(), SIGNAL(activated(QString)), this, SLOT(updateContextFolio(QString)));
#endif #else
connect(m_saw_folio->contextComboBox(), &QComboBox::textActivated, this, &ProjectAutoNumConfigPage::updateContextFolio);
#endif
// Auto Folio Numbering // Auto Folio Numbering
connect (m_faw, SIGNAL (applyPressed()), this, SLOT (applyAutoNum())); connect(m_faw, &FolioAutonumberingW::applyPressed, this, &ProjectAutoNumConfigPage::applyAutoNum);
} }
/** /**
+1 -1
View File
@@ -25,7 +25,7 @@ DiagramContextWidget::DiagramContextWidget(QWidget *parent) :
ui(new Ui::DiagramContextWidget) ui(new Ui::DiagramContextWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->m_table, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(checkTableRows())); connect(ui->m_table, &QTableWidget::itemChanged, this, &DiagramContextWidget::checkTableRows);
} }
DiagramContextWidget::~DiagramContextWidget() DiagramContextWidget::~DiagramContextWidget()
+3 -3
View File
@@ -62,7 +62,7 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
titleblock_infos = new TitleBlockPropertiesWidget(titleblock, false, diagram->project(), this); titleblock_infos = new TitleBlockPropertiesWidget(titleblock, false, diagram->project(), this);
titleblock_infos -> setReadOnly(diagram_is_read_only); 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 //titleblock_infos->setMinimumSize(590,480); //Minimum Size needed for correct display
//Conductor widget //Conductor widget
@@ -77,8 +77,8 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
// Buttons // Buttons
QDialogButtonBox boutons(diagram_is_read_only ? QDialogButtonBox::Ok : QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox boutons(diagram_is_read_only ? QDialogButtonBox::Ok : QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(&boutons, SIGNAL(accepted()), this, SLOT(accept())); connect(&boutons, &QDialogButtonBox::accepted, this, &DiagramPropertiesDialog::accept);
connect(&boutons, SIGNAL(rejected()), this, SLOT(reject())); connect(&boutons, &QDialogButtonBox::rejected, this, &DiagramPropertiesDialog::reject);
QGridLayout *glayout = new QGridLayout; QGridLayout *glayout = new QGridLayout;
glayout->addWidget(border_infos,0,0); glayout->addWidget(border_infos,0,0);
@@ -45,19 +45,15 @@ void DiagramPropertiesEditorDockWidget::setDiagram(Diagram *diagram)
if (m_diagram) if (m_diagram)
{ {
disconnect(m_diagram, SIGNAL(selectionChanged()), disconnect(m_diagram, &Diagram::selectionChanged, this, &DiagramPropertiesEditorDockWidget::selectionChanged);
this, SLOT(selectionChanged())); disconnect(m_diagram, &QObject::destroyed, this, &DiagramPropertiesEditorDockWidget::diagramWasDeleted);
disconnect(m_diagram, SIGNAL(destroyed()),
this, SLOT(diagramWasDeleted()));
} }
if (diagram) if (diagram)
{ {
m_diagram = diagram; m_diagram = diagram;
connect(m_diagram, SIGNAL(selectionChanged()), connect(m_diagram, &Diagram::selectionChanged, this, &DiagramPropertiesEditorDockWidget::selectionChanged, Qt::QueuedConnection);
this, SLOT(selectionChanged()), Qt::QueuedConnection); connect(m_diagram, &QObject::destroyed, this, &DiagramPropertiesEditorDockWidget::diagramWasDeleted);
connect(m_diagram, SIGNAL(destroyed()),
this, SLOT(diagramWasDeleted()));
selectionChanged(); selectionChanged();
} }
else else
+2 -4
View File
@@ -717,8 +717,7 @@ void LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked(
if (m_showed_element) if (m_showed_element)
{ {
disconnect(m_showed_element, SIGNAL(destroyed()), disconnect(m_showed_element, &QObject::destroyed, this, &LinkSingleElementWidget::showedElementWasDeleted);
this, SLOT(showedElementWasDeleted()));
m_showed_element->setHighlighted(false); m_showed_element->setHighlighted(false);
} }
@@ -726,8 +725,7 @@ void LinkSingleElementWidget::on_m_tree_widget_itemDoubleClicked(
elmt->diagram()->showMe(); elmt->diagram()->showMe();
elmt->setHighlighted(true); elmt->setHighlighted(true);
m_showed_element = elmt; m_showed_element = elmt;
connect(m_showed_element, SIGNAL(destroyed()), connect(m_showed_element, &QObject::destroyed, this, &LinkSingleElementWidget::showedElementWasDeleted);
this, SLOT(showedElementWasDeleted()));
} }
+4 -8
View File
@@ -154,14 +154,12 @@ void MasterPropertiesWidget::setElement(Element *element)
m_element->setHighlighted(false); m_element->setHighlighted(false);
if (m_project) if (m_project)
disconnect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)), disconnect(m_project, &QETProject::diagramRemoved, this, &MasterPropertiesWidget::diagramWasdeletedFromProject);
this, SLOT(diagramWasdeletedFromProject()));
if(Q_LIKELY(element->diagram() && element->diagram()->project())) if(Q_LIKELY(element->diagram() && element->diagram()->project()))
{ {
m_project = element->diagram()->project(); m_project = element->diagram()->project();
connect(m_project, SIGNAL(diagramRemoved(QETProject*,Diagram*)), connect(m_project, &QETProject::diagramRemoved, this, &MasterPropertiesWidget::diagramWasdeletedFromProject);
this, SLOT(diagramWasdeletedFromProject()));
} }
else else
m_project = nullptr; m_project = nullptr;
@@ -397,8 +395,7 @@ void MasterPropertiesWidget::showElementFromTWI(QTreeWidgetItem *qtwi, int colum
Q_UNUSED(column); Q_UNUSED(column);
if (m_showed_element) if (m_showed_element)
{ {
disconnect(m_showed_element, SIGNAL(destroyed()), disconnect(m_showed_element, &QObject::destroyed, this, &MasterPropertiesWidget::showedElementWasDeleted);
this, SLOT(showedElementWasDeleted()));
m_showed_element -> setHighlighted(false); m_showed_element -> setHighlighted(false);
} }
if (m_element) if (m_element)
@@ -407,8 +404,7 @@ void MasterPropertiesWidget::showElementFromTWI(QTreeWidgetItem *qtwi, int colum
m_showed_element = m_qtwi_hash[qtwi]; m_showed_element = m_qtwi_hash[qtwi];
m_showed_element->diagram()->showMe(); m_showed_element->diagram()->showMe();
m_showed_element->setHighlighted(true); m_showed_element->setHighlighted(true);
connect(m_showed_element, SIGNAL(destroyed()), connect(m_showed_element, &QObject::destroyed, this, &MasterPropertiesWidget::showedElementWasDeleted);
this, SLOT(showedElementWasDeleted()));
} }
/** /**
+2 -2
View File
@@ -45,8 +45,8 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *p
m_properties_dialog->addPage(new TerminalStripProjectConfigPage { project, parent }); m_properties_dialog->addPage(new TerminalStripProjectConfigPage { project, parent });
connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString))); connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString)));
connect(projectAutoNumConfigPage,SIGNAL(saveCurrentTbp()),newDiagramPage,SLOT(saveCurrentTbp())); connect(projectAutoNumConfigPage, &ProjectAutoNumConfigPage::saveCurrentTbp, newDiagramPage, &NewDiagramPage::saveCurrentTbp);
connect(projectAutoNumConfigPage,SIGNAL(loadSavedTbp()),newDiagramPage,SLOT(loadSavedTbp())); connect(projectAutoNumConfigPage, &ProjectAutoNumConfigPage::loadSavedTbp, newDiagramPage, &NewDiagramPage::loadSavedTbp);
} }
/** /**
+2 -2
View File
@@ -37,7 +37,7 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
{ {
ui->setupUi(this); ui->setupUi(this);
buildUi(); buildUi();
connect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool))); connect(ui->m_display_has_cross_rb, &QRadioButton::toggled, ui->m_cross_properties_gb, &QWidget::setEnabled);
connect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged())); 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_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int)));
updateDisplay(); updateDisplay();
@@ -49,7 +49,7 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
*/ */
XRefPropertiesWidget::~XRefPropertiesWidget() XRefPropertiesWidget::~XRefPropertiesWidget()
{ {
disconnect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_cross_properties_gb, SLOT(setEnabled(bool))); disconnect(ui->m_display_has_cross_rb, &QRadioButton::toggled, ui->m_cross_properties_gb, &QWidget::setEnabled);
disconnect(ui->m_type_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged())); 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_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int)));
delete ui; delete ui;