Gui: Add Action::setBlockedChecked

Remove the second parameter of Action::setChecked and
provide Action::setBlockedChecked instead.
This commit is contained in:
wmayer
2025-01-22 15:28:46 +01:00
committed by Ladislav Michl
parent 8644498400
commit 0ea02d60c1
6 changed files with 31 additions and 25 deletions

View File

@@ -137,16 +137,21 @@ void Action::setCheckable(bool check)
}
}
void Action::setChecked(bool check, bool no_signal)
void Action::setChecked(bool check)
{
bool blocked = false;
if (no_signal) {
blocked = _action->blockSignals(true);
}
_action->setChecked(check);
if (no_signal) {
_action->blockSignals(blocked);
}
}
/*!
* \brief Action::setBlockedChecked
* \param check
* Does the same as \ref setChecked but additionally blocks
* any signals.
*/
void Action::setBlockedChecked(bool check)
{
QSignalBlocker block(_action);
_action->setChecked(check);
}
bool Action::isChecked() const