Merge pull request #698 from arummler/master-modernize-signal-slot

Migrate string based signal/slot to method pointer
This commit is contained in:
Laurent Trinques
2026-08-09 21:08:28 +02:00
committed by GitHub
48 changed files with 344 additions and 402 deletions
+20 -49
View File
@@ -113,33 +113,19 @@ 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, &QETProject::folioAutoNumRemoved, this, qOverload<>(&AutoNumberingDockWidget::folioAutoNumChanged));
this,SLOT(folioAutoNumChanged())); disconnect(m_project, &QETProject::folioAutoNumAdded, this, qOverload<>(&AutoNumberingDockWidget::folioAutoNumChanged));
disconnect (m_project,SIGNAL(folioAutoNumAdded()), disconnect(m_project, &QETProject::defaultTitleBlockPropertiesChanged, this, &AutoNumberingDockWidget::setActive);
this,SLOT(folioAutoNumChanged()));
disconnect (this,
SIGNAL(folioAutoNumChanged(QString)),
&m_project_view->currentDiagram()->diagram()->border_and_titleblock,
SLOT (slot_setAutoPageNum(QString)));
disconnect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),
this,SLOT(setActive()));
//Conductor, Element and Folio Signals //Conductor, Element and Folio Signals
disconnect(m_project, &QETProject::autoNumContextUpdated, disconnect(m_project, &QETProject::autoNumContextUpdated,
@@ -152,33 +138,19 @@ 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, &QETProject::folioAutoNumRemoved, this, qOverload<>(&AutoNumberingDockWidget::folioAutoNumChanged));
this,SLOT(folioAutoNumChanged())); connect(m_project, &QETProject::folioAutoNumAdded, this, qOverload<>(&AutoNumberingDockWidget::folioAutoNumChanged));
connect (m_project,SIGNAL(folioAutoNumAdded()), connect(m_project, &QETProject::defaultTitleBlockPropertiesChanged, this, &AutoNumberingDockWidget::setActive);
this,SLOT(folioAutoNumChanged()));
connect (this,
SIGNAL(folioAutoNumChanged(QString)),
&m_project_view->currentDiagram()->diagram()->border_and_titleblock,
SLOT (slot_setAutoPageNum(QString)));
connect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),
this,SLOT(setActive()));
//Conductor, Element and Folio Signals //Conductor, Element and Folio Signals
connect(m_project, &QETProject::autoNumContextUpdated, connect(m_project, &QETProject::autoNumContextUpdated,
@@ -382,7 +354,6 @@ void AutoNumberingDockWidget::on_m_folio_cb_activated(int) {
if (new_properties != old_properties) if (new_properties != old_properties)
diagram->undoStack().push(new ChangeTitleBlockCommand(diagram, old_properties, new_properties)); diagram->undoStack().push(new ChangeTitleBlockCommand(diagram, old_properties, new_properties));
} }
emit(folioAutoNumChanged(current_autonum));
refreshRow(AutoNumCategory::Folio); refreshRow(AutoNumCategory::Folio);
} }
@@ -72,7 +72,6 @@ class AutoNumberingDockWidget : public QDockWidget
void on_m_folio_increase_sb_valueChanged(int); void on_m_folio_increase_sb_valueChanged(int);
signals: signals:
void folioAutoNumChanged(QString);
private: private:
enum class AutoNumCategory { Conductor, Element, Folio }; enum class AutoNumCategory { Conductor, Element, Folio };
+3 -3
View File
@@ -112,7 +112,7 @@ void SelectAutonumW::setContext(const NumerotationContext &context)
else { else {
for (int i=0; i<m_context.size(); ++i) { //build with the content of @context for (int i=0; i<m_context.size(); ++i) { //build with the content of @context
NumPartEditorW *part= new NumPartEditorW(m_context, i, m_edited_type, this); NumPartEditorW *part= new NumPartEditorW(m_context, i, m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable())); connect(part, &NumPartEditorW::changed, this, [this]() { applyEnable(); });
num_part_list_ << part; num_part_list_ << part;
ui -> editor_layout -> addWidget(part); ui -> editor_layout -> addWidget(part);
} }
@@ -145,7 +145,7 @@ void SelectAutonumW::on_add_button_clicked()
{ {
applyEnable(false); applyEnable(false);
NumPartEditorW *part = new NumPartEditorW(m_edited_type, this); NumPartEditorW *part = new NumPartEditorW(m_edited_type, this);
connect (part, SIGNAL(changed()), this, SLOT(applyEnable())); connect(part, &NumPartEditorW::changed, this, [this]() { applyEnable(); });
num_part_list_ << part; num_part_list_ << part;
ui -> editor_layout -> addWidget(part); ui -> editor_layout -> addWidget(part);
ui -> remove_button -> setEnabled(true); ui -> remove_button -> setEnabled(true);
@@ -160,7 +160,7 @@ void SelectAutonumW::on_remove_button_clicked()
//remove if @num_part_list contains more than one item //remove if @num_part_list contains more than one item
if (num_part_list_.size() > 1) { if (num_part_list_.size() > 1) {
NumPartEditorW *part = num_part_list_.takeLast(); NumPartEditorW *part = num_part_list_.takeLast();
disconnect(part, SIGNAL(changed()), this, SLOT(applyEnable())); // deliberately not disconnecting as not possible to resolve with lambda and will happen automatically when the object "part" is destroyed.
delete part; delete part;
if (num_part_list_.size() == 1) { if (num_part_list_.size() == 1) {
ui -> remove_button -> setDisabled(true); ui -> remove_button -> setDisabled(true);
+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()),
+5 -5
View File
@@ -79,7 +79,7 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
m_diagram->loadCndFolioSeq(); m_diagram->loadCndFolioSeq();
m_paste_here = new QAction(QET::Icons::EditPaste, tr("Coller ici", "context menu action"), this); m_paste_here = new QAction(QET::Icons::EditPaste, tr("Coller ici", "context menu action"), this);
connect(m_paste_here, SIGNAL(triggered()), this, SLOT(pasteHere())); connect(m_paste_here, &QAction::triggered, this, &DiagramView::pasteHere);
m_multi_paste = new QAction(QET::Icons::EditPaste, tr("Collage multiple"), this); m_multi_paste = new QAction(QET::Icons::EditPaste, tr("Collage multiple"), this);
connect(m_multi_paste, &QAction::triggered, [this]() { connect(m_multi_paste, &QAction::triggered, [this]() {
@@ -89,7 +89,7 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
// Setup the action to create a template // Setup the action to create a template
m_create_template = new QAction(tr("Créer un template", "context menu action"), this); m_create_template = new QAction(tr("Créer un template", "context menu action"), this);
connect(m_create_template, SIGNAL(triggered()), this, SLOT(createTemplateFromSelection())); connect(m_create_template, &QAction::triggered, this, &DiagramView::createTemplateFromSelection);
//setup three separators, to be use in context menu //setup three separators, to be use in context menu
for(int i=0 ; i<3 ; ++i) for(int i=0 ; i<3 ; ++i)
@@ -98,10 +98,10 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
m_separators.last()->setSeparator(true); m_separators.last()->setSeparator(true);
} }
connect(m_diagram, SIGNAL(showDiagram(Diagram*)), this, SIGNAL(showDiagram(Diagram*))); connect(m_diagram, &Diagram::showDiagram, this, &DiagramView::showDiagram);
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, &Diagram::findElementRequired, this, &DiagramView::findElementRequired);
QShortcut *edit_conductor_color_shortcut = new QShortcut(QKeySequence(Qt::Key_F2), this); QShortcut *edit_conductor_color_shortcut = new QShortcut(QKeySequence(Qt::Key_F2), this);
connect(edit_conductor_color_shortcut, &QShortcut::activated, [this]() connect(edit_conductor_color_shortcut, &QShortcut::activated, [this]()
+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
+4 -4
View File
@@ -51,13 +51,13 @@ 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()), &QTextDocument::contentsChanged,
this, this,
SLOT(adjustItemPosition())); [this]() { adjustItemPosition(); });
} }
/// Destructeur /// Destructeur
+18 -10
View File
@@ -582,17 +582,25 @@ bool StyleEditor::isStyleEditable(QList<CustomElementPart *> cep_list)
*/ */
void StyleEditor::activeConnections(bool active) { void StyleEditor::activeConnections(bool active) {
if (active) { if (active) {
connect (outline_color, SIGNAL(activated(int)), this, SLOT(updatePartColor())); connect(outline_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartColor);
connect(line_style, SIGNAL(activated(int)), this, SLOT(updatePartLineStyle())); connect(line_style, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineStyle);
connect(size_weight, SIGNAL(activated(int)), this, SLOT(updatePartLineWeight())); connect(size_weight, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineWeight);
connect(filling_color, SIGNAL(activated(int)), this, SLOT(updatePartFilling())); connect(filling_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartFilling);
connect(antialiasing, SIGNAL(stateChanged(int)), this, SLOT(updatePartAntialiasing())); #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) // TODO Qt 6.7: remove, checkStateChanged() always available
connect(antialiasing, &QCheckBox::stateChanged, this, &StyleEditor::updatePartAntialiasing);
#else
connect(antialiasing, &QCheckBox::checkStateChanged, this, &StyleEditor::updatePartAntialiasing);
#endif
} else { } else {
disconnect(outline_color, SIGNAL(activated(int)), this, SLOT(updatePartColor())); disconnect(outline_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartColor);
disconnect(line_style, SIGNAL(activated(int)), this, SLOT(updatePartLineStyle())); disconnect(line_style, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineStyle);
disconnect(size_weight, SIGNAL(activated(int)), this, SLOT(updatePartLineWeight())); disconnect(size_weight, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineWeight);
disconnect(filling_color, SIGNAL(activated(int)), this, SLOT(updatePartFilling())); disconnect(filling_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartFilling);
disconnect(antialiasing, SIGNAL(stateChanged(int)), this, SLOT(updatePartAntialiasing())); #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) // TODO Qt 6.7: remove, checkStateChanged() always available
disconnect(antialiasing, &QCheckBox::stateChanged, this, &StyleEditor::updatePartAntialiasing);
#else
disconnect(antialiasing, &QCheckBox::checkStateChanged, this, &StyleEditor::updatePartAntialiasing);
#endif
} }
} }
@@ -226,7 +226,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();
+1 -1
View File
@@ -848,7 +848,7 @@ bool QETElementEditor::event(QEvent *event)
{ {
if (m_first_activation && event->type() == QEvent::WindowActivate) { if (m_first_activation && event->type() == QEvent::WindowActivate) {
m_first_activation = false; m_first_activation = false;
QTimer::singleShot(250, m_view, SLOT(zoomFit())); QTimer::singleShot(250, m_view, &ElementView::zoomFit);
} }
return QMainWindow::event(event); return QMainWindow::event(event);
+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
@@ -75,7 +75,7 @@ ElementsPanel::ElementsPanel(QWidget *parent) :
// we handle double click on items ourselves // we handle double click on items ourselves
connect(this, &ElementsPanel::itemDoubleClicked, this, &ElementsPanel::slot_doubleClick); connect(this, &ElementsPanel::itemDoubleClicked, this, &ElementsPanel::slot_doubleClick);
connect(this, &GenericPanel::firstActivated, [this]() {QTimer::singleShot(250, this, SLOT(reload()));}); connect(this, &GenericPanel::firstActivated, [this]() {QTimer::singleShot(250, this, &ElementsPanel::reload);});
connect(this, &ElementsPanel::panelContentChanged, this, &ElementsPanel::panelContentChange); connect(this, &ElementsPanel::panelContentChanged, this, &ElementsPanel::panelContentChange);
// manage signal itemClicked // manage signal itemClicked
+29 -31
View File
@@ -96,44 +96,42 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
context_menu = new QMenu(this); context_menu = new QMenu(this);
connect(open_directory, SIGNAL(triggered()), this, SLOT(openDirectoryForSelectedItem())); connect(open_directory, &QAction::triggered, this, &ElementsPanelWidget::openDirectoryForSelectedItem);
connect(copy_path, SIGNAL(triggered()), this, SLOT(copyPathForSelectedItem())); connect(copy_path, &QAction::triggered, this, &ElementsPanelWidget::copyPathForSelectedItem);
connect(prj_activate, SIGNAL(triggered()), this, SLOT(activateProject())); connect(prj_activate, &QAction::triggered, this, &ElementsPanelWidget::activateProject);
connect(prj_close, SIGNAL(triggered()), this, SLOT(closeProject())); connect(prj_close, &QAction::triggered, this, &ElementsPanelWidget::closeProject);
connect(prj_edit_prop, SIGNAL(triggered()), this, SLOT(editProjectProperties())); connect(prj_edit_prop, &QAction::triggered, this, &ElementsPanelWidget::editProjectProperties);
connect(prj_prop_diagram, SIGNAL(triggered()), this, SLOT(editDiagramProperties())); connect(prj_prop_diagram, &QAction::triggered, this, &ElementsPanelWidget::editDiagramProperties);
connect(prj_add_diagram, SIGNAL(triggered()), this, SLOT(newDiagram())); connect(prj_add_diagram, &QAction::triggered, this, &ElementsPanelWidget::newDiagram);
connect(prj_insert_diagram_above, SIGNAL(triggered()), this, SLOT(insertDiagramAbove())); connect(prj_insert_diagram_above, &QAction::triggered, this, &ElementsPanelWidget::insertDiagramAbove);
connect(prj_insert_diagram_below, SIGNAL(triggered()), this, SLOT(insertDiagramBelow())); connect(prj_insert_diagram_below, &QAction::triggered, this, &ElementsPanelWidget::insertDiagramBelow);
connect(prj_del_diagram, SIGNAL(triggered()), this, SLOT(deleteDiagram())); connect(prj_del_diagram, &QAction::triggered, this, &ElementsPanelWidget::deleteDiagram);
connect(prj_duplicate_diagram, SIGNAL(triggered()), this, SLOT(duplicateDiagram())); connect(prj_duplicate_diagram, &QAction::triggered, this, &ElementsPanelWidget::duplicateDiagram);
connect(prj_move_diagram_up, SIGNAL(triggered()), this, SLOT(moveDiagramUp())); connect(prj_move_diagram_up, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramUp);
connect(prj_move_diagram_down, SIGNAL(triggered()), this, SLOT(moveDiagramDown())); connect(prj_move_diagram_down, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramDown);
connect(prj_move_diagram_top, SIGNAL(triggered()), this, SLOT(moveDiagramUpTop())); connect(prj_move_diagram_top, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramUpTop);
connect(prj_move_diagram_upx10, SIGNAL(triggered()), this, SLOT(moveDiagramUpx10())); connect(prj_move_diagram_upx10, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramUpx10);
connect(prj_move_diagram_upx100, SIGNAL(triggered()), this, SLOT(moveDiagramUpx100())); connect(prj_move_diagram_upx100, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramUpx100);
connect(prj_move_diagram_downx10, SIGNAL(triggered()), this, SLOT(moveDiagramDownx10())); connect(prj_move_diagram_downx10, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramDownx10);
connect(prj_move_diagram_downx100,SIGNAL(triggered()), this, SLOT(moveDiagramDownx100())); connect(prj_move_diagram_downx100, &QAction::triggered, this, &ElementsPanelWidget::moveDiagramDownx100);
connect(tbt_add, SIGNAL(triggered()), this, SLOT(addTitleBlockTemplate())); connect(tbt_add, &QAction::triggered, this, &ElementsPanelWidget::addTitleBlockTemplate);
connect(tbt_edit, SIGNAL(triggered()), this, SLOT(editTitleBlockTemplate())); connect(tbt_edit, &QAction::triggered, this, &ElementsPanelWidget::editTitleBlockTemplate);
connect(tbt_remove, SIGNAL(triggered()), this, SLOT(removeTitleBlockTemplate())); connect(tbt_remove, &QAction::triggered, this, &ElementsPanelWidget::removeTitleBlockTemplate);
connect(filter_textfield, &QLineEdit::textChanged, this, &ElementsPanelWidget::filterEdited);
connect(filter_textfield, SIGNAL(textChanged(const QString &)), this, SLOT(filterEdited(const QString &))); connect(elements_panel, &ElementsPanel::currentItemChanged, this, &ElementsPanelWidget::updateButtons);
connect(elements_panel, &ElementsPanel::customContextMenuRequested, this, &ElementsPanelWidget::handleContextMenu);
connect(elements_panel, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(updateButtons()));
connect(elements_panel, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(handleContextMenu(const QPoint &)));
connect( connect(
elements_panel, elements_panel,
SIGNAL(requestForTitleBlockTemplate(const TitleBlockTemplateLocation &)), &ElementsPanel::requestForTitleBlockTemplate,
QETApp::instance(), QETApp::instance(),
SLOT(openTitleBlockTemplate(const TitleBlockTemplateLocation &)) [app = QETApp::instance()](const TitleBlockTemplateLocation &location) { app->openTitleBlockTemplate(location); }
); );
// manage double click on TreeWidgetItem // manage double click on TreeWidgetItem
connect(elements_panel, SIGNAL(requestForProjectPropertiesEdition()), this, SLOT(editProjectProperties()) ); connect(elements_panel, &ElementsPanel::requestForProjectPropertiesEdition, this, &ElementsPanelWidget::editProjectProperties);
connect(elements_panel, SIGNAL(requestForDiagramPropertiesEdition()), this, SLOT(editDiagramProperties()) ); connect(elements_panel, &ElementsPanel::requestForDiagramPropertiesEdition, this, &ElementsPanelWidget::editDiagramProperties);
// manage project activation // manage project activation
connect(elements_panel, SIGNAL(requestForProject(QETProject*)), this, SIGNAL(requestForProject(QETProject*))); connect(elements_panel, &ElementsPanel::requestForProject, this, &ElementsPanelWidget::requestForProject);
// disposition verticale // disposition verticale
QVBoxLayout *vlayout = new QVBoxLayout(this); QVBoxLayout *vlayout = new QVBoxLayout(this);
+14 -14
View File
@@ -87,8 +87,8 @@ ExportDialog::ExportDialog(
deSelectAll -> setText(tr("Tout décocher")); deSelectAll -> setText(tr("Tout décocher"));
hLayout -> addWidget(selectAll); hLayout -> addWidget(selectAll);
hLayout -> addWidget(deSelectAll); hLayout -> addWidget(deSelectAll);
connect(selectAll, SIGNAL(clicked()), this, SLOT(slot_selectAllClicked())); connect(selectAll, &QPushButton::clicked, this, &ExportDialog::slot_selectAllClicked);
connect(deSelectAll, SIGNAL(clicked()), this, SLOT(slot_deSelectAllClicked())); connect(deSelectAll, &QPushButton::clicked, this, &ExportDialog::slot_deSelectAllClicked);
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
@@ -98,10 +98,10 @@ ExportDialog::ExportDialog(
layout -> addWidget(buttons); layout -> addWidget(buttons);
// connexions signaux/slots // connexions signaux/slots
connect(epw, SIGNAL(formatChanged()), this, SLOT(slot_changeFilesExtension())); connect(epw, &ExportPropertiesWidget::formatChanged, this, [this]() { 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);
@@ -174,25 +174,25 @@ 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);
height_mapper_ -> setMapping(diagram_line -> height, line_count); height_mapper_ -> setMapping(diagram_line -> height, line_count);
ratio_mapper_ -> setMapping(diagram_line -> keep_ratio, line_count); ratio_mapper_ -> setMapping(diagram_line -> keep_ratio, line_count);
reset_mapper_ -> setMapping(diagram_line -> reset_size, line_count); reset_mapper_ -> setMapping(diagram_line -> reset_size, line_count);
connect(diagram_line -> width, SIGNAL(valueChanged(int)), width_mapper_, SLOT(map())); connect(diagram_line -> width, qOverload<int>(&QSpinBox::valueChanged), width_mapper_, qOverload<>(&QSignalMapper::map));
connect(diagram_line -> height, SIGNAL(valueChanged(int)), height_mapper_, SLOT(map())); connect(diagram_line -> height, qOverload<int>(&QSpinBox::valueChanged), height_mapper_, qOverload<>(&QSignalMapper::map));
connect(diagram_line -> keep_ratio, SIGNAL(toggled(bool)), ratio_mapper_, SLOT(map())); connect(diagram_line -> keep_ratio, &QPushButton::toggled, ratio_mapper_, qOverload<>(&QSignalMapper::map));
connect(diagram_line -> reset_size, SIGNAL(clicked(bool)), reset_mapper_, SLOT(map())); connect(diagram_line -> reset_size, &QPushButton::clicked, reset_mapper_, qOverload<>(&QSignalMapper::map));
// mappings et signaux pour l'apercu du schema // mappings et signaux pour l'apercu du schema
preview_mapper_ -> setMapping(diagram_line -> preview, line_count); preview_mapper_ -> setMapping(diagram_line -> preview, line_count);
connect(diagram_line -> preview, SIGNAL(clicked(bool)), preview_mapper_, SLOT(map())); connect(diagram_line -> preview, &QPushButton::clicked, preview_mapper_, qOverload<>(&QSignalMapper::map));
// mappings et signaux pour l'export du schema vers le presse-papier // mappings et signaux pour l'export du schema vers le presse-papier
clipboard_mapper_ -> setMapping(diagram_line -> clipboard, line_count); clipboard_mapper_ -> setMapping(diagram_line -> clipboard, line_count);
connect(diagram_line -> clipboard, SIGNAL(clicked(bool)), clipboard_mapper_, SLOT(map())); connect(diagram_line -> clipboard, &QPushButton::clicked, clipboard_mapper_, qOverload<>(&QSignalMapper::map));
} }
QWidget *widget_diagrams_list = new QWidget(); QWidget *widget_diagrams_list = new QWidget();
@@ -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);
+20 -10
View File
@@ -236,16 +236,26 @@ 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, qOverload<int>(&QComboBox::currentIndexChanged), this, &ExportPropertiesWidget::formatChanged);
connect(exported_content_choices, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(exportedAreaChanged())); connect(exported_content_choices, qOverload<QAbstractButton*>(&QButtonGroup::buttonClicked), this, &ExportPropertiesWidget::exportedAreaChanged);
connect(draw_grid, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); #if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) // TODO Qt 6.7: remove, checkStateChanged() always available
connect(draw_border, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); connect(draw_grid, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_titleblock, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); connect(draw_border, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_terminals, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); connect(draw_titleblock, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_terminal_names, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); connect(draw_terminals, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_bg_transparent, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); connect(draw_terminal_names, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_colored_conductors, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); connect(draw_bg_transparent, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_colored_conductors, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
#else
connect(draw_grid, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_border, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_titleblock, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_terminals, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_terminal_names, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_bg_transparent, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_colored_conductors, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
#endif
} }
+1 -1
View File
@@ -1033,7 +1033,7 @@ bool GenericPanel::event(QEvent *event) {
if (first_activation_) { if (first_activation_) {
if (event -> type() == QEvent::WindowActivate if (event -> type() == QEvent::WindowActivate
|| event -> type() == QEvent::Show) { || event -> type() == QEvent::Show) {
QTimer::singleShot(250, this, SLOT(emitFirstActivated())); QTimer::singleShot(250, this, &GenericPanel::emitFirstActivated);
first_activation_ = false; first_activation_ = false;
} }
} }
+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();
+14 -15
View File
@@ -1796,7 +1796,7 @@ void QETApp::checkRemainingWindows()
*/ */
static bool sleep = true; static bool sleep = true;
if (sleep) { if (sleep) {
QTimer::singleShot(500, this, SLOT(checkRemainingWindows())); QTimer::singleShot(500, this, &QETApp::checkRemainingWindows);
} else { } else {
if (!diagramEditors().count() && !elementEditors().count()) { if (!diagramEditors().count() && !elementEditors().count()) {
qApp->quit(); qApp->quit();
@@ -2405,24 +2405,23 @@ void QETApp::initSystemTray()
reduce_appli -> setToolTip(tr("Réduire QElectroTech dans le systray")); reduce_appli -> setToolTip(tr("Réduire QElectroTech dans le systray"));
restore_appli -> setToolTip(tr("Restaurer QElectroTech")); restore_appli -> setToolTip(tr("Restaurer QElectroTech"));
connect(quitter_qet, SIGNAL(triggered()), this, SLOT(quitQET())); connect(quitter_qet, &QAction::triggered, this, &QETApp::quitQET);
connect(reduce_appli, SIGNAL(triggered()), this, SLOT(reduceEveryEditor())); connect(reduce_appli, &QAction::triggered, this, &QETApp::reduceEveryEditor);
connect(restore_appli, SIGNAL(triggered()), this, SLOT(restoreEveryEditor())); connect(restore_appli, &QAction::triggered, this, &QETApp::restoreEveryEditor);
connect(reduce_diagrams, SIGNAL(triggered()), this, SLOT(reduceDiagramEditors())); connect(reduce_diagrams, &QAction::triggered, this, &QETApp::reduceDiagramEditors);
connect(restore_diagrams, SIGNAL(triggered()), this, SLOT(restoreDiagramEditors())); connect(restore_diagrams, &QAction::triggered, this, &QETApp::restoreDiagramEditors);
connect(reduce_elements, SIGNAL(triggered()), this, SLOT(reduceElementEditors())); connect(reduce_elements, &QAction::triggered, this, &QETApp::reduceElementEditors);
connect(restore_elements, SIGNAL(triggered()), this, SLOT(restoreElementEditors())); connect(restore_elements, &QAction::triggered, this, &QETApp::restoreElementEditors);
connect(reduce_templates, SIGNAL(triggered()), this, SLOT(reduceTitleBlockTemplateEditors())); connect(reduce_templates, &QAction::triggered, this, &QETApp::reduceTitleBlockTemplateEditors);
connect(restore_templates,SIGNAL(triggered()), this, SLOT(restoreTitleBlockTemplateEditors())); connect(restore_templates, &QAction::triggered, this, &QETApp::restoreTitleBlockTemplateEditors);
connect(new_diagram, SIGNAL(triggered()), this, SLOT(newDiagramEditor())); connect(new_diagram, &QAction::triggered, this, &QETApp::newDiagramEditor);
connect(new_element, SIGNAL(triggered()), this, SLOT(newElementEditor())); connect(new_element, &QAction::triggered, this, &QETApp::newElementEditor);
// initialization of the systray icon // initialization of the systray icon
// initialisation de l'icone du systray // initialisation de l'icone du systray
m_qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this); m_qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this);
m_qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip")); m_qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip"));
connect(m_qsti, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), connect(m_qsti, &QSystemTrayIcon::activated, this, &QETApp::systray);
this, SLOT(systray(QSystemTrayIcon::ActivationReason)));
m_qsti -> setContextMenu(menu_systray); m_qsti -> setContextMenu(menu_systray);
m_qsti -> show(); m_qsti -> show();
} }
@@ -2442,7 +2441,7 @@ template <class T> void QETApp::addWindowsListToMenu(
QAction *current_menu = menu -> addAction(window -> windowTitle()); QAction *current_menu = menu -> addAction(window -> windowTitle());
current_menu -> setCheckable(true); current_menu -> setCheckable(true);
current_menu -> setChecked(window -> isVisible()); current_menu -> setChecked(window -> isVisible());
connect(current_menu, SIGNAL(triggered()), &signal_map, SLOT(map())); connect(current_menu, &QAction::triggered, &signal_map, qOverload<>(&QSignalMapper::map));
signal_map.setMapping(current_menu, window); signal_map.setMapping(current_menu, window);
} }
} }
+24 -38
View File
@@ -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();
@@ -185,20 +179,20 @@ 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, &ElementsPanelWidget::requestForProjectPropertiesEdition, this, qOverload<QETProject*>(&QETDiagramEditor::editProjectProperties));
connect(pa, SIGNAL(requestForNewDiagram (QETProject *)), this, SLOT(addDiagramToProject(QETProject *))); connect(pa, &ElementsPanelWidget::requestForNewDiagram, this, &QETDiagramEditor::addDiagramToProject);
connect(pa, SIGNAL(requestForNewDiagramAt (QETProject *, int)), this, SLOT(addDiagramToProjectAt(QETProject *, int))); connect(pa, &ElementsPanelWidget::requestForNewDiagramAt, this, &QETDiagramEditor::addDiagramToProjectAt);
connect(pa, SIGNAL(requestForDiagramPropertiesEdition (Diagram *)), this, SLOT(editDiagramProperties(Diagram *))); connect(pa, &ElementsPanelWidget::requestForDiagramPropertiesEdition, this, qOverload<Diagram*>(&QETDiagramEditor::editDiagramProperties));
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);
} }
/** /**
@@ -871,8 +865,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);
@@ -994,7 +987,7 @@ bool QETDiagramEditor::event(QEvent *e)
if (m_first_show && e->type() == QEvent::WindowActivate) if (m_first_show && e->type() == QEvent::WindowActivate)
{ {
m_first_show = false; m_first_show = false;
QTimer::singleShot(250, m_element_collection_widget, SLOT(reload())); QTimer::singleShot(250, m_element_collection_widget, &ElementsCollectionWidget::reload);
} }
return(QETMainWindow::event(e)); return(QETMainWindow::event(e));
} }
@@ -1971,23 +1964,19 @@ 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, qOverload<DiagramView*>(&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,
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) {
@@ -2156,7 +2145,7 @@ void QETDiagramEditor::slot_updateWindowsMenu()
action -> setStatusTip(QString(tr("Active le projet « %1 »")).arg(pv_title)); action -> setStatusTip(QString(tr("Active le projet « %1 »")).arg(pv_title));
action -> setCheckable(true); action -> setCheckable(true);
action -> setChecked(project_view == currentProjectView()); action -> setChecked(project_view == currentProjectView());
connect(action, SIGNAL(triggered()), &windowMapper, SLOT(map())); connect(action, &QAction::triggered, &windowMapper, qOverload<>(&QSignalMapper::map));
windowMapper.setMapping(action, project_view); windowMapper.setMapping(action, project_view);
} }
} }
@@ -2572,10 +2561,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;
} }
+4 -4
View File
@@ -83,13 +83,13 @@ void QETMainWindow::initCommonActions()
fullscreen_action_ = new QAction(this); fullscreen_action_ = new QAction(this);
updateFullScreenAction(); updateFullScreenAction();
connect(fullscreen_action_, SIGNAL(triggered()), this, SLOT(toggleFullScreen())); connect(fullscreen_action_, &QAction::triggered, this, &QETMainWindow::toggleFullScreen);
whatsthis_action_ = QWhatsThis::createAction(this); whatsthis_action_ = QWhatsThis::createAction(this);
about_qet_ = new QAction(QET::Icons::QETLogo, tr("À &propos de QElectroTech"), this); about_qet_ = new QAction(QET::Icons::QETLogo, tr("À &propos de QElectroTech"), this);
about_qet_ -> setStatusTip(tr("Affiche des informations sur QElectroTech", "status bar tip")); about_qet_ -> setStatusTip(tr("Affiche des informations sur QElectroTech", "status bar tip"));
connect(about_qet_, SIGNAL(triggered()), qet_app, SLOT(aboutQET())); connect(about_qet_, &QAction::triggered, qet_app, &QETApp::aboutQET);
manual_online_ = new QAction(QET::Icons::QETManual, tr("Manuel en ligne"), this); manual_online_ = new QAction(QET::Icons::QETManual, tr("Manuel en ligne"), this);
manual_online_ -> setStatusTip(tr("Lance le navigateur par défaut vers le manuel en ligne de QElectroTech", "status bar tip")); manual_online_ -> setStatusTip(tr("Lance le navigateur par défaut vers le manuel en ligne de QElectroTech", "status bar tip"));
@@ -135,7 +135,7 @@ void QETMainWindow::initCommonActions()
about_qt_ = new QAction(QET::Icons::QtLogo, tr("À propos de &Qt"), this); about_qt_ = new QAction(QET::Icons::QtLogo, tr("À propos de &Qt"), this);
about_qt_ -> setStatusTip(tr("Affiche des informations sur la bibliothèque Qt", "status bar tip")); about_qt_ -> setStatusTip(tr("Affiche des informations sur la bibliothèque Qt", "status bar tip"));
connect(about_qt_, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(about_qt_, &QAction::triggered, qApp, &QApplication::aboutQt);
diagnostics_action_ = new QAction(QET::Icons::DialogInformation, tr("Enregistrer un rapport de diagnostic..."), this); diagnostics_action_ = new QAction(QET::Icons::DialogInformation, tr("Enregistrer un rapport de diagnostic..."), this);
diagnostics_action_ -> setStatusTip(tr("Génère un rapport avec les derniers messages de journalisation, pour l'inclure dans un rapport de bug", "status bar tip")); diagnostics_action_ -> setStatusTip(tr("Génère un rapport avec les derniers messages de journalisation, pour l'inclure dans un rapport de bug", "status bar tip"));
@@ -152,7 +152,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
@@ -203,7 +203,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);
} }
/** /**
+7 -8
View File
@@ -118,24 +118,23 @@ void QTextOrientationSpinBoxWidget::build()
// met en place les relations entre le SpinBox et le QTextOrientationWidget // met en place les relations entre le SpinBox et le QTextOrientationWidget
connect(spin_box_, connect(spin_box_,
SIGNAL(valueChanged(double)), qOverload<double>(&QDoubleSpinBox::valueChanged),
orientation_widget_, orientation_widget_,
SLOT(setOrientation(double))); &QTextOrientationWidget::setOrientation);
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_,
SIGNAL(orientationChanged(double)), &QTextOrientationWidget::orientationChanged,
spin_box_, spin_box_,
SIGNAL(editingFinished())); &QDoubleSpinBox::editingFinished);
// 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);
+3 -3
View File
@@ -143,15 +143,15 @@ void TitleBlockDimensionWidget::initWidgets()
dimension_type_ -> addButton(relative_button_, QET::RelativeToTotalLength); dimension_type_ -> addButton(relative_button_, QET::RelativeToTotalLength);
dimension_type_ -> addButton(remaining_button_, QET::RelativeToRemainingLength); dimension_type_ -> addButton(remaining_button_, QET::RelativeToRemainingLength);
absolute_button_ -> setChecked(true); absolute_button_ -> setChecked(true);
connect(dimension_type_, SIGNAL(buttonClicked(int)), this, SLOT(updateSpinBoxSuffix())); connect(dimension_type_, qOverload<QAbstractButton*>(&QButtonGroup::buttonClicked), this, &TitleBlockDimensionWidget::updateSpinBoxSuffix);
} }
updateSpinBoxSuffix(); updateSpinBoxSuffix();
// 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);
} }
/** /**
+44 -44
View File
@@ -142,7 +142,7 @@ void QETTitleBlockTemplateEditor::firstActivation(QEvent *event)
Q_UNUSED(event) Q_UNUSED(event)
if (duplicate_ && !opened_from_file_ && location_.parentCollection()) { if (duplicate_ && !opened_from_file_ && location_.parentCollection()) {
// this editor is supposed to duplicate its current location // this editor is supposed to duplicate its current location
QTimer::singleShot(250, this, SLOT(duplicateCurrentLocation())); QTimer::singleShot(250, this, &QETTitleBlockTemplateEditor::duplicateCurrentLocation);
} }
} }
@@ -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
@@ -411,26 +411,26 @@ void QETTitleBlockTemplateEditor::initActions()
ShortcutManager::instance().registerAction(zoom_fit_, "titleblockeditor.zoom_fit", tr("Éditeur de cartouche"), Qt::CTRL | Qt::Key_9); ShortcutManager::instance().registerAction(zoom_fit_, "titleblockeditor.zoom_fit", tr("Éditeur de cartouche"), Qt::CTRL | Qt::Key_9);
ShortcutManager::instance().registerAction(zoom_reset_, "titleblockeditor.zoom_reset", tr("Éditeur de cartouche"), Qt::CTRL | Qt::Key_0); ShortcutManager::instance().registerAction(zoom_reset_, "titleblockeditor.zoom_reset", tr("Éditeur de cartouche"), Qt::CTRL | Qt::Key_0);
connect(new_, SIGNAL(triggered()), this, SLOT(newTemplate())); connect(new_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::newTemplate);
connect(open_, SIGNAL(triggered()), this, SLOT(open())); connect(open_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::open);
connect(open_from_file_, SIGNAL(triggered()), this, SLOT(openFromFile())); connect(open_from_file_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::openFromFile);
connect(save_, SIGNAL(triggered()), this, SLOT(save())); connect(save_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::save);
connect(save_as_, SIGNAL(triggered()), this, SLOT(saveAs())); connect(save_as_, &QAction::triggered, this, qOverload<>(&QETTitleBlockTemplateEditor::saveAs));
connect(save_as_file_, SIGNAL(triggered()), this, SLOT(saveAsFile())); connect(save_as_file_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::saveAsFile);
connect(quit_, SIGNAL(triggered()), this, SLOT(quit())); connect(quit_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::quit);
connect(cut_, SIGNAL(triggered()), template_edition_area_view_, SLOT(cut())); connect(cut_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::cut);
connect(copy_, SIGNAL(triggered()), template_edition_area_view_, SLOT(copy())); connect(copy_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::copy);
connect(paste_, SIGNAL(triggered()), template_edition_area_view_, SLOT(paste())); connect(paste_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::paste);
connect(zoom_in_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomIn())); connect(zoom_in_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomIn);
connect(zoom_out_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomOut())); connect(zoom_out_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomOut);
connect(zoom_fit_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomFit())); connect(zoom_fit_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomFit);
connect(zoom_reset_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomReset())); connect(zoom_reset_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomReset);
connect(edit_logos_, SIGNAL(triggered()), this, SLOT(editLogos())); connect(edit_logos_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::editLogos);
connect(edit_info_, SIGNAL(triggered()), this, SLOT(editTemplateInformation())); connect(edit_info_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::editTemplateInformation);
connect(add_row_, SIGNAL(triggered()), template_edition_area_view_, SLOT(addRowAtEnd())); connect(add_row_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::addRowAtEnd);
connect(add_col_, SIGNAL(triggered()), template_edition_area_view_, SLOT(addColumnAtEnd())); connect(add_col_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::addColumnAtEnd);
connect(merge_cells_, SIGNAL(triggered()), template_edition_area_view_, SLOT(mergeSelectedCells())); connect(merge_cells_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::mergeSelectedCells);
connect(split_cell_, SIGNAL(triggered()), template_edition_area_view_, SLOT(splitSelectedCell())); connect(split_cell_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::splitSelectedCell);
} }
/** /**
@@ -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()));
} }
/** /**
@@ -593,9 +595,9 @@ void QETTitleBlockTemplateEditor::initLogoManager()
logo_manager_ -> setReadOnly(read_only_); logo_manager_ -> setReadOnly(read_only_);
connect( connect(
logo_manager_, logo_manager_,
SIGNAL(logosChanged(const TitleBlockTemplate *)), &TitleBlockTemplateLogoManager::logosChanged,
template_cell_editor_widget_, template_cell_editor_widget_,
SLOT(updateLogosComboBox(const TitleBlockTemplate *)) &TitleBlockTemplateCellWidget::updateLogosComboBox
); );
} }
@@ -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_) {
+12 -12
View File
@@ -145,20 +145,20 @@ void TitleBlockTemplateCellWidget::initWidgets()
setLayout(cell_editor_layout_); setLayout(cell_editor_layout_);
// trigger the logo manager // trigger the logo manager
connect(add_logo_input_, SIGNAL(released()), this, SIGNAL(logoEditionRequested())); connect(add_logo_input_, &QPushButton::released, this, &TitleBlockTemplateCellWidget::logoEditionRequested);
// handle cell modifications // handle cell modifications
connect(cell_type_input_, SIGNAL(activated(int)), this, SLOT(updateFormType(int))); connect(cell_type_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::updateFormType);
connect(cell_type_input_, SIGNAL(activated(int)), this, SLOT(editType())); connect(cell_type_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::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_, &QCheckBox::clicked, this, &TitleBlockTemplateCellWidget::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_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editAlignment);
connect(vert_align_input_, SIGNAL(activated(int)), this, SLOT(editAlignment())); connect(vert_align_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editAlignment);
connect(font_size_input_, SIGNAL(valueChanged(int)), this, SLOT(editFontSize())); connect(font_size_input_, qOverload<int>(&QSpinBox::valueChanged), this, &TitleBlockTemplateCellWidget::editFontSize);
connect(font_adjust_input_, SIGNAL(clicked(bool)), this, SLOT(editAdjust())); connect(font_adjust_input_, &QCheckBox::clicked, this, &TitleBlockTemplateCellWidget::editAdjust);
connect(logo_input_, SIGNAL(activated(int)), this, SLOT(editLogo())); connect(logo_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editLogo);
updateFormType(TitleBlockCell::TextCell); updateFormType(TitleBlockCell::TextCell);
} }
@@ -98,8 +98,7 @@ void TitleBlockTemplateLocationChooser::init()
templates_ = new QComboBox(); templates_ = new QComboBox();
updateCollections(); updateCollections();
connect(collections_, SIGNAL(currentIndexChanged(int)), connect(collections_, qOverload<int>(&QComboBox::currentIndexChanged), this, &TitleBlockTemplateLocationChooser::updateTemplates);
this, SLOT(updateTemplates()));
form_layout_ = new QFormLayout(); form_layout_ = new QFormLayout();
form_layout_ -> addRow( form_layout_ -> addRow(
+1 -1
View File
@@ -80,7 +80,7 @@ void TitleBlockTemplateLocationSaver::setLocation(const TitleBlockTemplateLocati
void TitleBlockTemplateLocationSaver::init() void TitleBlockTemplateLocationSaver::init()
{ {
new_name_ = new QLineEdit(); new_name_ = new QLineEdit();
connect(templates_, SIGNAL(currentIndexChanged(int)), this, SLOT(updateNewName())); connect(templates_, qOverload<int>(&QComboBox::currentIndexChanged), this, &TitleBlockTemplateLocationSaver::updateNewName);
form_layout_ -> addRow(tr("ou nouveau nom", "used in save as form"), new_name_); form_layout_ -> addRow(tr("ou nouveau nom", "used in save as form"), new_name_);
updateTemplates(); updateTemplates();
} }
+11 -11
View File
@@ -123,16 +123,15 @@ void TitleBlockTemplateLogoManager::initWidgets()
vlayout0_ -> addWidget(logo_box_); vlayout0_ -> addWidget(logo_box_);
setLayout(vlayout0_); setLayout(vlayout0_);
connect( connect(logos_view_,
logos_view_, &QListWidget::currentItemChanged,
SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
this, this,
SLOT(updateLogoInformations(QListWidgetItem *, QListWidgetItem *)) &TitleBlockTemplateLogoManager::updateLogoInformations
); );
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);
} }
/** /**
@@ -214,11 +213,12 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na
signal_mapper -> setMapping(replace_button, QDialogButtonBox::YesRole); signal_mapper -> setMapping(replace_button, QDialogButtonBox::YesRole);
signal_mapper -> setMapping(rename_button, QDialogButtonBox::NoRole); signal_mapper -> setMapping(rename_button, QDialogButtonBox::NoRole);
signal_mapper -> setMapping(cancel_button, QDialogButtonBox::RejectRole); signal_mapper -> setMapping(cancel_button, QDialogButtonBox::RejectRole);
connect(replace_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); connect(replace_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map));
connect(rename_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); connect(rename_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map));
connect(cancel_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); connect(cancel_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map));
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO Qt6 only: remove, mappedInt() always available #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) // TODO 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)));
#else #else
connect(signal_mapper, &QSignalMapper::mappedInt, rename_dialog, &QDialog::done); connect(signal_mapper, &QSignalMapper::mappedInt, rename_dialog, &QDialog::done);
#endif #endif
+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);
} }
/** /**
+19 -25
View File
@@ -584,20 +584,20 @@ void TitleBlockTemplateView::init()
delete_row_ = new QAction(QET::Icons::EditTableDeleteRow, tr("Supprimer cette ligne", "context menu"), this); delete_row_ = new QAction(QET::Icons::EditTableDeleteRow, tr("Supprimer cette ligne", "context menu"), this);
change_preview_width_ = new QAction( tr("Modifier la largeur de cet aperçu", "context menu"), this); change_preview_width_ = new QAction( tr("Modifier la largeur de cet aperçu", "context menu"), this);
connect(add_column_before_, SIGNAL(triggered()), this, SLOT(addColumnBefore())); connect(add_column_before_, &QAction::triggered, this, &TitleBlockTemplateView::addColumnBefore);
connect(add_row_before_, SIGNAL(triggered()), this, SLOT(addRowBefore())); connect(add_row_before_, &QAction::triggered, this, &TitleBlockTemplateView::addRowBefore);
connect(add_column_after_, SIGNAL(triggered()), this, SLOT(addColumnAfter())); connect(add_column_after_, &QAction::triggered, this, &TitleBlockTemplateView::addColumnAfter);
connect(add_row_after_, SIGNAL(triggered()), this, SLOT(addRowAfter())); connect(add_row_after_, &QAction::triggered, this, &TitleBlockTemplateView::addRowAfter);
connect(edit_column_dim_, SIGNAL(triggered()), this, SLOT(editColumn())); connect(edit_column_dim_, &QAction::triggered, this, [this]() { editColumn(); });
connect(edit_row_dim_, SIGNAL(triggered()), this, SLOT(editRow())); connect(edit_row_dim_, &QAction::triggered, this, [this]() { editRow(); });
connect(delete_column_, SIGNAL(triggered()), this, SLOT(deleteColumn())); connect(delete_column_, &QAction::triggered, this, &TitleBlockTemplateView::deleteColumn);
connect(delete_row_, SIGNAL(triggered()), this, SLOT(deleteRow())); connect(delete_row_, &QAction::triggered, this, &TitleBlockTemplateView::deleteRow);
connect(change_preview_width_, SIGNAL(triggered()), this, SLOT(changePreviewWidth())); connect(change_preview_width_, &QAction::triggered, this, &TitleBlockTemplateView::changePreviewWidth);
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;
@@ -691,7 +691,7 @@ void TitleBlockTemplateView::applyRowsHeights(bool animate) {
animation -> setStartValue(QVariant(tbgrid_ -> rowMinimumHeight(ROW_OFFSET + i))); animation -> setStartValue(QVariant(tbgrid_ -> rowMinimumHeight(ROW_OFFSET + i)));
animation -> setEndValue(QVariant(1.0 * heights.at(i))); animation -> setEndValue(QVariant(1.0 * heights.at(i)));
animation -> setDuration(500); animation -> setDuration(500);
connect(animation, SIGNAL(finished()), this, SLOT(updateRowsHelperCells())); connect(animation, &GridLayoutAnimation::finished, this, &TitleBlockTemplateView::updateRowsHelperCells);
animation -> start(QAbstractAnimation::DeleteWhenStopped); animation -> start(QAbstractAnimation::DeleteWhenStopped);
} }
@@ -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);
} }
@@ -869,7 +863,7 @@ void TitleBlockTemplateView::fillWithEmptyCells()
*/ */
bool TitleBlockTemplateView::event(QEvent *event) { bool TitleBlockTemplateView::event(QEvent *event) {
if (first_activation_ && event -> type() == QEvent::WindowActivate) { if (first_activation_ && event -> type() == QEvent::WindowActivate) {
QTimer::singleShot(250, this, SLOT(zoomFit())); QTimer::singleShot(250, this, &TitleBlockTemplateView::zoomFit);
first_activation_ = false; first_activation_ = false;
} }
return(QGraphicsView::event(event)); return(QGraphicsView::event(event));
+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);
} }
/** /**
+2 -2
View File
@@ -391,7 +391,7 @@ 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);
@@ -421,7 +421,7 @@ void ProjectAutoNumConfigPage::buildConnections()
#endif #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
+1 -1
View File
@@ -148,7 +148,7 @@ bool ElementInfoWidget::event(QEvent *event)
{ {
if (event -> type() == QEvent::WindowActivate || event -> type() == QEvent::Show) 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; m_first_activation = false;
} }
} }
+2 -2
View File
@@ -403,9 +403,9 @@ QWidget *ElementPropertiesWidget::generalWidget()
//button widget //button widget
QPushButton *find_in_panel = new QPushButton(QET::Icons::ZoomDraw, tr("Retrouver dans le panel"), general_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); 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; QHBoxLayout *hlayout_ = new QHBoxLayout;
hlayout_->addWidget(find_in_panel); hlayout_->addWidget(find_in_panel);
hlayout_->addWidget(edit_element); hlayout_->addWidget(edit_element);
+3 -5
View File
@@ -528,7 +528,7 @@ void LinkSingleElementWidget::diagramWasRemovedFromProject()
// contains the master element linked to the edited element // contains the master element linked to the edited element
// we must wait for this elements to be unlinked, // we must wait for this elements to be unlinked,
// or else the list of available master isn't up to date // 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() void LinkSingleElementWidget::showedElementWasDeleted()
@@ -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()));
} }
+5 -9
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()));
} }
/** /**
@@ -431,7 +427,7 @@ void MasterPropertiesWidget::diagramWasdeletedFromProject()
// contains slave element linked to the edited element // contains slave element linked to the edited element
// we must wait for this elements be unlinked, // we must wait for this elements be unlinked,
// or else the linked list provides deleted elements. // or else the linked list provides deleted elements.
QTimer::singleShot(10, this, SLOT(updateUi())); QTimer::singleShot(10, this, &MasterPropertiesWidget::updateUi);
} }
/** /**
+3 -3
View File
@@ -44,9 +44,9 @@ 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, qOverload<QString>(&ProjectAutoNumConfigPage::setAutoNum), newDiagramPage, &NewDiagramPage::setFolioAutonum);
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);
} }
/** /**
+6 -6
View File
@@ -353,13 +353,13 @@ void TitleBlockPropertiesWidget::initDialog(
this); this);
connect(m_tbt_edit, connect(m_tbt_edit,
SIGNAL(triggered()), &QAction::triggered,
this, this,
SLOT(editCurrentTitleBlockTemplate())); &TitleBlockPropertiesWidget::editCurrentTitleBlockTemplate);
connect(m_tbt_duplicate, connect(m_tbt_duplicate,
SIGNAL(triggered()), &QAction::triggered,
this, this,
SLOT(duplicateCurrentTitleBlockTemplate())); &TitleBlockPropertiesWidget::duplicateCurrentTitleBlockTemplate);
m_tbt_menu = new QMenu(tr("Title block templates actions"), ui->m_tbt_pb); 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_edit);
@@ -367,9 +367,9 @@ void TitleBlockPropertiesWidget::initDialog(
ui -> m_tbt_pb -> setMenu(m_tbt_menu); ui -> m_tbt_pb -> setMenu(m_tbt_menu);
connect(ui->m_tbt_cb, connect(ui->m_tbt_cb,
SIGNAL(currentIndexChanged(int)), qOverload<int>(&QComboBox::currentIndexChanged),
this, this,
SLOT(changeCurrentTitleBlockTemplate(int))); &TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate);
if (project!= nullptr){ if (project!= nullptr){
keys_2 = project -> folioAutoNum().keys(); keys_2 = project -> folioAutoNum().keys();
+6 -6
View File
@@ -37,9 +37,9 @@ 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, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::typeChanged);
connect(ui->m_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int))); connect(ui->m_snap_to_cb, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::enableOffsetSB);
updateDisplay(); updateDisplay();
} }
@@ -49,9 +49,9 @@ 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, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::typeChanged);
disconnect(ui->m_snap_to_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableOffsetSB(int))); disconnect(ui->m_snap_to_cb, qOverload<int>(&QComboBox::currentIndexChanged), this, &XRefPropertiesWidget::enableOffsetSB);
delete ui; delete ui;
} }
+2 -2
View File
@@ -120,8 +120,8 @@ void RotateTextsCommand::openDialog()
ori_widget->spinBox()->selectAll(); ori_widget->spinBox()->selectAll();
QDialogButtonBox buttons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox buttons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(&buttons, SIGNAL(accepted()), &ori_text_dialog, SLOT(accept())); QObject::connect(&buttons, &QDialogButtonBox::accepted, &ori_text_dialog, &QDialog::accept);
QObject::connect(&buttons, SIGNAL(rejected()), &ori_text_dialog, SLOT(reject())); QObject::connect(&buttons, &QDialogButtonBox::rejected, &ori_text_dialog, &QDialog::reject);
QVBoxLayout layout_v(&ori_text_dialog); QVBoxLayout layout_v(&ori_text_dialog);
layout_v.setSizeConstraint(QLayout::SetFixedSize); layout_v.setSizeConstraint(QLayout::SetFixedSize);