Fix a few warnings regarding `QAbstractButton::setChecked` usage

The method takes a boolean, not a `Qt::CheckState`. Since the rest of
the codebase uses booleans, I didn't bother keeping the enum where it
was possible (for checkboxes, one could use `setCheckState` with a
`Qt::CheckState` but that's only really useful for tristate checkboxes).

Note that this shouldn't change any behavior as the enum has a value of
0 for the `Unchecked` variant.
This commit is contained in:
Bastien Orivel 2020-10-28 15:58:14 +01:00 committed by Vicki Pfau
parent 535f35055d
commit 7421431a1d
2 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ BattleChipView::BattleChipView(std::shared_ptr<CoreController> controller, Windo
m_model.setScale(size);
connect(m_ui.chipId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), m_ui.inserted, [this]() {
m_ui.inserted->setChecked(Qt::Unchecked);
m_ui.inserted->setChecked(false);
});
connect(m_ui.chipName, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), m_ui.chipId, [this](int id) {
if (id < 0) {
@ -103,11 +103,11 @@ BattleChipView::BattleChipView(std::shared_ptr<CoreController> controller, Windo
m_controller->attachBattleChipGate();
setFlavor(4);
if (qtitle.startsWith("AGB-B4B") || qtitle.startsWith("AGB-B4W") || qtitle.startsWith("AGB-BR4") || qtitle.startsWith("AGB-BZ3")) {
m_ui.gateBattleChip->setChecked(Qt::Checked);
m_ui.gateBattleChip->setChecked(true);
} else if (qtitle.startsWith("AGB-BRB") || qtitle.startsWith("AGB-BRK")) {
m_ui.gateProgress->setChecked(Qt::Checked);
m_ui.gateProgress->setChecked(true);
} else if (qtitle.startsWith("AGB-BR5") || qtitle.startsWith("AGB-BR6")) {
m_ui.gateBeastLink->setChecked(Qt::Checked);
m_ui.gateBeastLink->setChecked(true);
}
if (!QFileInfo(GBAApp::dataDir() + "/chips.rcc").exists() && !QFileInfo(ConfigController::configDir() + "/chips.rcc").exists()) {

View File

@ -1080,7 +1080,7 @@ void IOViewer::updateRegister() {
}
for (int i = 0; i < 16; ++i) {
m_b[i]->setChecked(value & (1 << i) ? Qt::Checked : Qt::Unchecked);
m_b[i]->setChecked(value & (1 << i));
}
m_value = value;
emit valueChanged();