Skip to content

Commit

Permalink
src/gui/widgets/settings: remove deprecated statechanged signals
Browse files Browse the repository at this point in the history
Replaced stateChanged() with checkStateChanged() signals.
  • Loading branch information
ripose-jp committed Oct 28, 2024
1 parent b060a0e commit 5fc75d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/gui/widgets/settings/ankisettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ AnkiSettings::AnkiSettings(QWidget *parent)
initIcons();

connect(
m_ui->checkBoxEnabled, &QCheckBox::stateChanged,
m_ui->checkBoxEnabled, &QCheckBox::checkStateChanged,
this, &AnkiSettings::enabledStateChanged
);
connect(
Expand All @@ -124,8 +124,8 @@ AnkiSettings::AnkiSettings(QWidget *parent)
this, [=] { connectToClient(true); }
);
connect(
m_ui->checkboxAdvanced, &QCheckBox::stateChanged, this,
[=] (int state) {
m_ui->checkboxAdvanced, &QCheckBox::checkStateChanged, this,
[=] (Qt::CheckState state) {
m_ui->frameAdvanced->setVisible(state == Qt::Checked);
}
);
Expand Down Expand Up @@ -425,7 +425,7 @@ void AnkiSettings::updateModelFields(CardBuilder *cb, const QString &model)
/* End AnkiConnect Actions */
/* Begin UI Management */

void AnkiSettings::enabledStateChanged(int state)
void AnkiSettings::enabledStateChanged(Qt::CheckState state)
{
bool enabled = state == Qt::CheckState::Checked;
m_ui->frameContent->setEnabled(enabled);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/settings/ankisettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ 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.
*/
void enabledStateChanged(int state);
void enabledStateChanged(Qt::CheckState state);

/**
* Connects to AnkiConnect and updates the decks, models, and fields.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/settings/interfacesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ InterfaceSettings::InterfaceSettings(QWidget *parent)
[=] { askButtonColor(m_ui->buttonSubStroke, m_strokeColor); }
);

connect(m_ui->checkStyleSheets, &QCheckBox::stateChanged, this,
[=] (const int state) {
connect(m_ui->checkStyleSheets, &QCheckBox::checkStateChanged, this,
[=] (Qt::CheckState state) {
m_ui->frameStyleSheets->setEnabled(
state == Qt::CheckState::Checked
);
Expand Down

0 comments on commit 5fc75d9

Please sign in to comment.