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.
Bastien Orivel eijebong@bananium.fr
Wed, 28 Oct 2020 15:58:14 +0100
3 files changed,
8 insertions(+),
8 deletions(-)
M
src/platform/qt/BattleChipView.cpp
→
src/platform/qt/BattleChipView.cpp
@@ -50,7 +50,7 @@ m_ui.chipList->setGridSize(m_ui.chipList->gridSize() * size);
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 @@
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()) {
M
src/platform/qt/GIFView.cpp
→
src/platform/qt/GIFView.cpp
@@ -94,11 +94,11 @@ m_filename = filename;
if (!FFmpegEncoderIsOpen(&m_encoder)) { m_ui.start->setEnabled(!filename.isEmpty()); if (filename.endsWith(".gif")) { - m_ui.fmtGif->setChecked(Qt::Checked); + m_ui.fmtGif->setChecked(true); } else if (filename.endsWith(".png") || filename.endsWith(".apng")) { - m_ui.fmtApng->setChecked(Qt::Checked); + m_ui.fmtApng->setChecked(true); } else if (filename.endsWith(".webp")) { - m_ui.fmtWebP->setChecked(Qt::Checked); + m_ui.fmtWebP->setChecked(true); } } }
M
src/platform/qt/IOViewer.cpp
→
src/platform/qt/IOViewer.cpp
@@ -1080,7 +1080,7 @@ value = GBAView16(static_cast<ARMCore*>(m_controller->thread()->core->cpu), BASE_IO | m_register);
} 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();