Use QAbstractButton::toggled

Also, fix dbconverter build
This commit is contained in:
Basile Clément 2025-03-20 21:49:04 +01:00
parent 688720bfac
commit 5d8ebff892
No known key found for this signature in database
3 changed files with 7 additions and 17 deletions

View file

@ -166,12 +166,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
includeOnlineOnlyCards = SettingsCache::instance().getIncludeOnlineOnlyCards();
QCheckBox *onlineOnly = new QCheckBox(tr("Include online-only (Arena) cards [requires restart]"));
onlineOnly->setChecked(includeOnlineOnlyCards);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
connect(onlineOnly, &QCheckBox::checkStateChanged, this, &WndSets::onlineOnlyCheckStateChanged);
#else
connect(onlineOnly, &QCheckBox::stateChanged, this,
[this](int state) { onlineOnlyCheckStateChanged(static_cast<Qt::CheckState>(state)); });
#endif
connect(onlineOnly, &QAbstractButton::toggled, this, &WndSets::includeOnlineOnlyCardsChanged);
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actSave()));
@ -251,17 +246,9 @@ void WndSets::rebuildMainLayout(int actionToTake)
}
}
void WndSets::onlineOnlyCheckStateChanged(Qt::CheckState state)
void WndSets::includeOnlineOnlyCardsChanged(bool _includeOnlineOnlyCards)
{
switch (state) {
case Qt::Unchecked:
includeOnlineOnlyCards = false;
break;
default:
includeOnlineOnlyCards = true;
break;
}
includeOnlineOnlyCards = _includeOnlineOnlyCards;
}
void WndSets::actSave()

View file

@ -74,7 +74,7 @@ private slots:
void actDisableResetButton(const QString &filterText);
void actSort(int index);
void actIgnoreWarning();
void onlineOnlyCheckStateChanged(Qt::CheckState state);
void includeOnlineOnlyCardsChanged(bool _includeOnlineOnlyCardsChanged);
};
#endif