Migration of signal/slot to method pointer continued. Mostly simple cases.

This commit is contained in:
Andre Rummler
2026-08-09 01:34:22 +02:00
parent c12137c5a0
commit 201bd4c5f6
15 changed files with 104 additions and 114 deletions
+22 -22
View File
@@ -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_reset_, "titleblockeditor.zoom_reset", tr("Éditeur de cartouche"), Qt::CTRL | Qt::Key_0);
connect(new_, SIGNAL(triggered()), this, SLOT(newTemplate()));
connect(open_, SIGNAL(triggered()), this, SLOT(open()));
connect(open_from_file_, SIGNAL(triggered()), this, SLOT(openFromFile()));
connect(save_, SIGNAL(triggered()), this, SLOT(save()));
connect(save_as_, SIGNAL(triggered()), this, SLOT(saveAs()));
connect(save_as_file_, SIGNAL(triggered()), this, SLOT(saveAsFile()));
connect(quit_, SIGNAL(triggered()), this, SLOT(quit()));
connect(cut_, SIGNAL(triggered()), template_edition_area_view_, SLOT(cut()));
connect(copy_, SIGNAL(triggered()), template_edition_area_view_, SLOT(copy()));
connect(paste_, SIGNAL(triggered()), template_edition_area_view_, SLOT(paste()));
connect(zoom_in_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomIn()));
connect(zoom_out_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomOut()));
connect(zoom_fit_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomFit()));
connect(zoom_reset_, SIGNAL(triggered()), template_edition_area_view_, SLOT(zoomReset()));
connect(edit_logos_, SIGNAL(triggered()), this, SLOT(editLogos()));
connect(edit_info_, SIGNAL(triggered()), this, SLOT(editTemplateInformation()));
connect(add_row_, SIGNAL(triggered()), template_edition_area_view_, SLOT(addRowAtEnd()));
connect(add_col_, SIGNAL(triggered()), template_edition_area_view_, SLOT(addColumnAtEnd()));
connect(merge_cells_, SIGNAL(triggered()), template_edition_area_view_, SLOT(mergeSelectedCells()));
connect(split_cell_, SIGNAL(triggered()), template_edition_area_view_, SLOT(splitSelectedCell()));
connect(new_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::newTemplate);
connect(open_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::open);
connect(open_from_file_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::openFromFile);
connect(save_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::save);
connect(save_as_, &QAction::triggered, this, qOverload<>(&QETTitleBlockTemplateEditor::saveAs));
connect(save_as_file_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::saveAsFile);
connect(quit_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::quit);
connect(cut_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::cut);
connect(copy_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::copy);
connect(paste_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::paste);
connect(zoom_in_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomIn);
connect(zoom_out_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomOut);
connect(zoom_fit_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomFit);
connect(zoom_reset_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::zoomReset);
connect(edit_logos_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::editLogos);
connect(edit_info_, &QAction::triggered, this, &QETTitleBlockTemplateEditor::editTemplateInformation);
connect(add_row_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::addRowAtEnd);
connect(add_col_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::addColumnAtEnd);
connect(merge_cells_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::mergeSelectedCells);
connect(split_cell_, &QAction::triggered, template_edition_area_view_, &TitleBlockTemplateView::splitSelectedCell);
}
/**
@@ -595,9 +595,9 @@ void QETTitleBlockTemplateEditor::initLogoManager()
logo_manager_ -> setReadOnly(read_only_);
connect(
logo_manager_,
SIGNAL(logosChanged(const TitleBlockTemplate *)),
&TitleBlockTemplateLogoManager::logosChanged,
template_cell_editor_widget_,
SLOT(updateLogosComboBox(const TitleBlockTemplate *))
&TitleBlockTemplateCellWidget::updateLogosComboBox
);
}
+3 -3
View File
@@ -145,19 +145,19 @@ void TitleBlockTemplateCellWidget::initWidgets()
setLayout(cell_editor_layout_);
// 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
connect(cell_type_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::updateFormType);
connect(cell_type_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editType);
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_, &QPushButton::released, this, &TitleBlockTemplateCellWidget::editLabel);
connect(value_edit_, &QPushButton::released, this, &TitleBlockTemplateCellWidget::editValue);
connect(horiz_align_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editAlignment);
connect(vert_align_input_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editAlignment);
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_, qOverload<int>(&QComboBox::activated), this, &TitleBlockTemplateCellWidget::editLogo);
updateFormType(TitleBlockCell::TextCell);
+6 -7
View File
@@ -123,11 +123,10 @@ void TitleBlockTemplateLogoManager::initWidgets()
vlayout0_ -> addWidget(logo_box_);
setLayout(vlayout0_);
connect(
logos_view_,
SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)),
connect(logos_view_,
&QListWidget::currentItemChanged,
this,
SLOT(updateLogoInformations(QListWidgetItem *, QListWidgetItem *))
&TitleBlockTemplateLogoManager::updateLogoInformations
);
connect(add_button_, &QPushButton::released, this, &TitleBlockTemplateLogoManager::addLogo);
connect(export_button_, &QPushButton::released, this, &TitleBlockTemplateLogoManager::exportLogo);
@@ -214,9 +213,9 @@ QString TitleBlockTemplateLogoManager::confirmLogoName(const QString &initial_na
signal_mapper -> setMapping(replace_button, QDialogButtonBox::YesRole);
signal_mapper -> setMapping(rename_button, QDialogButtonBox::NoRole);
signal_mapper -> setMapping(cancel_button, QDialogButtonBox::RejectRole);
connect(replace_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
connect(rename_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
connect(cancel_button, SIGNAL(clicked()), signal_mapper, SLOT(map()));
connect(replace_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::map));
connect(rename_button, &QPushButton::clicked, signal_mapper, qOverload<>(&QSignalMapper::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
connect(signal_mapper, SIGNAL(mapped(int)), rename_dialog, SLOT(done(int)));
+10 -10
View File
@@ -584,15 +584,15 @@ void TitleBlockTemplateView::init()
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);
connect(add_column_before_, SIGNAL(triggered()), this, SLOT(addColumnBefore()));
connect(add_row_before_, SIGNAL(triggered()), this, SLOT(addRowBefore()));
connect(add_column_after_, SIGNAL(triggered()), this, SLOT(addColumnAfter()));
connect(add_row_after_, SIGNAL(triggered()), this, SLOT(addRowAfter()));
connect(edit_column_dim_, SIGNAL(triggered()), this, SLOT(editColumn()));
connect(edit_row_dim_, SIGNAL(triggered()), this, SLOT(editRow()));
connect(delete_column_, SIGNAL(triggered()), this, SLOT(deleteColumn()));
connect(delete_row_, SIGNAL(triggered()), this, SLOT(deleteRow()));
connect(change_preview_width_, SIGNAL(triggered()), this, SLOT(changePreviewWidth()));
connect(add_column_before_, &QAction::triggered, this, &TitleBlockTemplateView::addColumnBefore);
connect(add_row_before_, &QAction::triggered, this, &TitleBlockTemplateView::addRowBefore);
connect(add_column_after_, &QAction::triggered, this, &TitleBlockTemplateView::addColumnAfter);
connect(add_row_after_, &QAction::triggered, this, &TitleBlockTemplateView::addRowAfter);
connect(edit_column_dim_, &QAction::triggered, this, [this]() { editColumn(); });
connect(edit_row_dim_, &QAction::triggered, this, [this]() { editRow(); });
connect(delete_column_, &QAction::triggered, this, &TitleBlockTemplateView::deleteColumn);
connect(delete_row_, &QAction::triggered, this, &TitleBlockTemplateView::deleteRow);
connect(change_preview_width_, &QAction::triggered, this, &TitleBlockTemplateView::changePreviewWidth);
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
setBackgroundBrush(QBrush(QColor(248, 255, 160)));
@@ -691,7 +691,7 @@ void TitleBlockTemplateView::applyRowsHeights(bool animate) {
animation -> setStartValue(QVariant(tbgrid_ -> rowMinimumHeight(ROW_OFFSET + i)));
animation -> setEndValue(QVariant(1.0 * heights.at(i)));
animation -> setDuration(500);
connect(animation, SIGNAL(finished()), this, SLOT(updateRowsHelperCells()));
connect(animation, &GridLayoutAnimation::finished, this, &TitleBlockTemplateView::updateRowsHelperCells);
animation -> start(QAbstractAnimation::DeleteWhenStopped);
}