Modernizes the signal/slot connect and solves the disambiguities of the remaining currentIndexChanged(int) connects via qOverload<int>, since

QComboBox::currentIndexChanged(QString) still exists pre-Qt6.

TitleBlockTemplateLocationChooser: collections_ -> updateTemplates() (a virtual method; pointer-to-member dispatch still resolves to the
TitleBlockTemplateLocationSaver override at runtime as expected)
TitleBlockTemplateLocationSaver: templates_ -> updateNewName()
TitleBlockPropertiesWidget: m_tbt_cb -> changeCurrentTitleBlockTemplate(int)
XRefPropertiesWidget: m_type_cb -> typeChanged(), m_snap_to_cb ->enableOffsetSB(int), both connect (constructor) and disconnect(destructor)
This commit is contained in:
Andre Rummler
2026-08-08 18:37:53 +02:00
parent 438e2ade3a
commit 293e61abeb
4 changed files with 10 additions and 11 deletions
@@ -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();
} }
+4 -4
View File
@@ -348,10 +348,10 @@ void TitleBlockPropertiesWidget::initDialog(
m_tbt_menu -> addAction(m_tbt_duplicate); m_tbt_menu -> addAction(m_tbt_duplicate);
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();
+4 -4
View File
@@ -38,8 +38,8 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
ui->setupUi(this); ui->setupUi(this);
buildUi(); buildUi();
connect(ui->m_display_has_cross_rb, &QRadioButton::toggled, ui->m_cross_properties_gb, &QWidget::setEnabled); 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();
} }
@@ -50,8 +50,8 @@ XRefPropertiesWidget::XRefPropertiesWidget(QHash <QString, XRefProperties> prope
XRefPropertiesWidget::~XRefPropertiesWidget() XRefPropertiesWidget::~XRefPropertiesWidget()
{ {
disconnect(ui->m_display_has_cross_rb, &QRadioButton::toggled, ui->m_cross_properties_gb, &QWidget::setEnabled); 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;
} }