Modernize and fix buttonClicked connects.

Two QButtonGroup::buttonClicked overload-ambiguity fixes, plus cleanup of the connects sitting alongside them:

TitleBlockDimensionWidget: switched from the deprecated buttonClicked(int) id-based overload to buttonClicked(QAbstractButton*),
disambiguated via qOverload. The slot doesn't use the argument either way, so this is a pure modernization with no behavior change.
ExportPropertiesWidget: same buttonClicked fix for exported_content_choices, plus modernized the adjacent
currentIndexChanged(int) relay (disambiguated via qOverload, since QComboBox::currentIndexChanged(QString) still exists pre-Qt6) and
six QCheckBox::stateChanged(int) relays (single signal, no disambiguation needed).

QCheckBox::stateChanged(int) is deprecated as of Qt 6.7 in favor of checkStateChanged(Qt::CheckState), but this project has no Qt6 minor
version floor pinned in CMakeLists.txt, so stateChanged(int) remains the correct unconditional choice for now. QT_VERSION_CHECK(6, 7, 0) guarded
checkStateChanged was introduced to avoid future warnings.
This commit is contained in:
Andre Rummler
2026-08-08 18:25:08 +02:00
parent 62ad49a6d3
commit 438e2ade3a
2 changed files with 18 additions and 9 deletions
+17 -8
View File
@@ -233,12 +233,21 @@ void ExportPropertiesWidget::build()
connect(button_browse, &QPushButton::released, this, &ExportPropertiesWidget::slot_chooseADirectory);
// emission de signaux lors du changement de format et lors du changement de zone exportee
connect(format, SIGNAL(currentIndexChanged(int)), this, SIGNAL(formatChanged()));
connect(exported_content_choices, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(exportedAreaChanged()));
connect(draw_grid, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged()));
connect(draw_border, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged()));
connect(draw_titleblock, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged()));
connect(draw_terminals, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged()));
connect(draw_bg_transparent, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged()));
connect(draw_colored_conductors, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged()));
connect(format, qOverload<int>(&QComboBox::currentIndexChanged), this, &ExportPropertiesWidget::formatChanged);
connect(exported_content_choices, qOverload<QAbstractButton*>(&QButtonGroup::buttonClicked), this, &ExportPropertiesWidget::exportedAreaChanged);
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) // TODO Qt 6.7: remove, checkStateChanged() always available
connect(draw_grid, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_border, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_titleblock, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_terminals, &QCheckBox::stateChanged, this, &ExportPropertiesWidget::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_bg_transparent, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
connect(draw_colored_conductors, &QCheckBox::checkStateChanged, this, &ExportPropertiesWidget::optionChanged);
#endif
}
+1 -1
View File
@@ -143,7 +143,7 @@ void TitleBlockDimensionWidget::initWidgets()
dimension_type_ -> addButton(relative_button_, QET::RelativeToTotalLength);
dimension_type_ -> addButton(remaining_button_, QET::RelativeToRemainingLength);
absolute_button_ -> setChecked(true);
connect(dimension_type_, SIGNAL(buttonClicked(int)), this, SLOT(updateSpinBoxSuffix()));
connect(dimension_type_, qOverload<QAbstractButton*>(&QButtonGroup::buttonClicked), this, &TitleBlockDimensionWidget::updateSpinBoxSuffix);
}
updateSpinBoxSuffix();