Use checkStateChanged(Qt::CheckState) with Qt >= 6.7

This commit is contained in:
Jonas Kvinge
2024-05-24 02:13:48 +02:00
parent 9f2e4ac312
commit c655963483
6 changed files with 34 additions and 1 deletions

View File

@@ -172,7 +172,11 @@ EditTagDialog::EditTagDialog(Application *app, QWidget *parent)
QObject::connect(spinbox, &SpinBox::Reset, this, &EditTagDialog::ResetField);
}
else if (CheckBox *checkbox = qobject_cast<CheckBox*>(widget)) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
QObject::connect(checkbox, &QCheckBox::checkStateChanged, this, &EditTagDialog::FieldValueEdited);
#else
QObject::connect(checkbox, &QCheckBox::stateChanged, this, &EditTagDialog::FieldValueEdited);
#endif
QObject::connect(checkbox, &CheckBox::Reset, this, &EditTagDialog::ResetField);
}
else if (RatingBox *ratingbox = qobject_cast<RatingBox*>(widget)) {