Migrating the remaining signal/slot connects with an ambigious activated(int) via qOverload<int>,

since QComboBox::activated(QString) still exists pre-Qt6 and makes &QComboBox::activated alone ambiguous:

- StyleEditor: outline_color/line_style/size_weight/filling_color,
  both connect (activeConnections(true)) and disconnect
  (activeConnections(false)) branches. antialiasing's stateChanged(int)
  connect modernized alongside them (single signal, no disambiguation
  needed).
- TitleBlockTemplateCellWidget: cell_type_input_ (two connects to
  different slots), horiz_align_input_, vert_align_input_, logo_input_.

Also modernises QETApp's system tray connect.

In two cases stateChanged already replaced with version guarded checkStateChanged for future proofing.
This commit is contained in:
Andre Rummler
2026-08-08 21:29:17 +02:00
parent 79da321ddc
commit a668ccfa90
5 changed files with 34 additions and 27 deletions
+18 -10
View File
@@ -582,17 +582,25 @@ bool StyleEditor::isStyleEditable(QList<CustomElementPart *> cep_list)
*/
void StyleEditor::activeConnections(bool active) {
if (active) {
connect (outline_color, SIGNAL(activated(int)), this, SLOT(updatePartColor()));
connect(line_style, SIGNAL(activated(int)), this, SLOT(updatePartLineStyle()));
connect(size_weight, SIGNAL(activated(int)), this, SLOT(updatePartLineWeight()));
connect(filling_color, SIGNAL(activated(int)), this, SLOT(updatePartFilling()));
connect(antialiasing, SIGNAL(stateChanged(int)), this, SLOT(updatePartAntialiasing()));
connect(outline_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartColor);
connect(line_style, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineStyle);
connect(size_weight, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineWeight);
connect(filling_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartFilling);
#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 {
disconnect(outline_color, SIGNAL(activated(int)), this, SLOT(updatePartColor()));
disconnect(line_style, SIGNAL(activated(int)), this, SLOT(updatePartLineStyle()));
disconnect(size_weight, SIGNAL(activated(int)), this, SLOT(updatePartLineWeight()));
disconnect(filling_color, SIGNAL(activated(int)), this, SLOT(updatePartFilling()));
disconnect(antialiasing, SIGNAL(stateChanged(int)), this, SLOT(updatePartAntialiasing()));
disconnect(outline_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartColor);
disconnect(line_style, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineStyle);
disconnect(size_weight, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartLineWeight);
disconnect(filling_color, qOverload<int>(&QComboBox::activated), this, &StyleEditor::updatePartFilling);
#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
}
}