diff --git a/src/gui/widgets/settings/ankisettings.cpp b/src/gui/widgets/settings/ankisettings.cpp index fa18dd9..a753e02 100644 --- a/src/gui/widgets/settings/ankisettings.cpp +++ b/src/gui/widgets/settings/ankisettings.cpp @@ -112,8 +112,14 @@ AnkiSettings::AnkiSettings(QWidget *parent) initIcons(); connect( - m_ui->checkBoxEnabled, &QCheckBox::stateChanged, - this, &AnkiSettings::enabledStateChanged + m_ui->checkBoxEnabled, +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::stateChanged, +#else + &QCheckBox::checkStateChanged, +#endif + this, + &AnkiSettings::enabledStateChanged ); connect( m_ui->comboBoxProfile, &QComboBox::currentTextChanged, @@ -124,8 +130,19 @@ AnkiSettings::AnkiSettings(QWidget *parent) this, [=] { connectToClient(true); } ); connect( - m_ui->checkboxAdvanced, &QCheckBox::stateChanged, this, - [=] (int state) { + m_ui->checkboxAdvanced, +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::stateChanged, +#else + &QCheckBox::checkStateChanged, +#endif + this, +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + [=] (int state) +#else + [=] (Qt::CheckState state) +#endif + { m_ui->frameAdvanced->setVisible(state == Qt::Checked); } ); @@ -425,7 +442,11 @@ void AnkiSettings::updateModelFields(CardBuilder *cb, const QString &model) /* End AnkiConnect Actions */ /* Begin UI Management */ +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) void AnkiSettings::enabledStateChanged(int state) +#else +void AnkiSettings::enabledStateChanged(Qt::CheckState state) +#endif { bool enabled = state == Qt::CheckState::Checked; m_ui->frameContent->setEnabled(enabled); diff --git a/src/gui/widgets/settings/ankisettings.h b/src/gui/widgets/settings/ankisettings.h index 2e20adb..393f3af 100644 --- a/src/gui/widgets/settings/ankisettings.h +++ b/src/gui/widgets/settings/ankisettings.h @@ -83,9 +83,13 @@ private Q_SLOTS: /** * Called when the Anki Integration Enabled checkbox is changed. * Enables/Disables widgets on the front end. - * @param state The checkbox state (Qt::CheckState). + * @param state The checkbox state. */ +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) void enabledStateChanged(int state); +#else + void enabledStateChanged(Qt::CheckState state); +#endif /** * Connects to AnkiConnect and updates the decks, models, and fields. diff --git a/src/gui/widgets/settings/interfacesettings.cpp b/src/gui/widgets/settings/interfacesettings.cpp index c86c538..7b062e6 100644 --- a/src/gui/widgets/settings/interfacesettings.cpp +++ b/src/gui/widgets/settings/interfacesettings.cpp @@ -58,8 +58,20 @@ InterfaceSettings::InterfaceSettings(QWidget *parent) [=] { askButtonColor(m_ui->buttonSubStroke, m_strokeColor); } ); - connect(m_ui->checkStyleSheets, &QCheckBox::stateChanged, this, - [=] (const int state) { + connect( + m_ui->checkStyleSheets, +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + &QCheckBox::stateChanged, +#else + &QCheckBox::checkStateChanged, +#endif + this, +#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0) + [=] (int state) +#else + [=] (Qt::CheckState state) +#endif + { m_ui->frameStyleSheets->setEnabled( state == Qt::CheckState::Checked );