diff --git a/src/duckstation-qt/biossettingswidget.cpp b/src/duckstation-qt/biossettingswidget.cpp index 321e10396..50e9ba8fe 100644 --- a/src/duckstation-qt/biossettingswidget.cpp +++ b/src/duckstation-qt/biossettingswidget.cpp @@ -38,12 +38,11 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.pioImagePath, "PIO", "FlashImagePath"); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pioSwitchActive, "PIO", "SwitchActive", true); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.pioImageWrites, "PIO", "FlashImageWriteEnable", false); - connect(m_ui.pioDeviceType, QOverload::of(&QComboBox::currentIndexChanged), this, - &BIOSSettingsWidget::onPIODeviceTypeChanged); + connect(m_ui.pioDeviceType, &QComboBox::currentIndexChanged, this, &BIOSSettingsWidget::onPIODeviceTypeChanged); connect(m_ui.pioImagePathBrowse, &QPushButton::clicked, this, &BIOSSettingsWidget::onPIOImagePathBrowseClicked); onPIODeviceTypeChanged(); - connect(m_ui.imageNTSCJ, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + connect(m_ui.imageNTSCJ, &QComboBox::currentIndexChanged, [this](int index) { if (m_dialog->isPerGameSettings() && index == 0) { m_dialog->removeSettingValue("BIOS", "PathNTSCJ"); @@ -54,7 +53,7 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) m_ui.imageNTSCJ->itemData(index).toString().toStdString().c_str()); } }); - connect(m_ui.imageNTSCU, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + connect(m_ui.imageNTSCU, &QComboBox::currentIndexChanged, [this](int index) { if (m_dialog->isPerGameSettings() && index == 0) { m_dialog->removeSettingValue("BIOS", "PathNTSCU"); @@ -65,7 +64,7 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent) m_ui.imageNTSCU->itemData(index).toString().toStdString().c_str()); } }); - connect(m_ui.imagePAL, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + connect(m_ui.imagePAL, &QComboBox::currentIndexChanged, [this](int index) { if (m_dialog->isPerGameSettings() && index == 0) { m_dialog->removeSettingValue("BIOS", "PathPAL"); diff --git a/src/duckstation-qt/controllerbindingwidgets.cpp b/src/duckstation-qt/controllerbindingwidgets.cpp index 489ac3d54..595a5aee0 100644 --- a/src/duckstation-qt/controllerbindingwidgets.cpp +++ b/src/duckstation-qt/controllerbindingwidgets.cpp @@ -52,8 +52,7 @@ ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSett populateControllerTypes(); populateWidgets(); - connect(m_ui.controllerType, QOverload::of(&QComboBox::currentIndexChanged), this, - &ControllerBindingWidget::onTypeChanged); + connect(m_ui.controllerType, &QComboBox::currentIndexChanged, this, &ControllerBindingWidget::onTypeChanged); connect(m_ui.bindings, &QPushButton::clicked, this, &ControllerBindingWidget::onBindingsClicked); connect(m_ui.settings, &QPushButton::clicked, this, &ControllerBindingWidget::onSettingsClicked); connect(m_ui.macros, &QPushButton::clicked, this, &ControllerBindingWidget::onMacrosClicked); diff --git a/src/duckstation-qt/emulationsettingswidget.cpp b/src/duckstation-qt/emulationsettingswidget.cpp index d1598bb49..b2def15c5 100644 --- a/src/duckstation-qt/emulationsettingswidget.cpp +++ b/src/duckstation-qt/emulationsettingswidget.cpp @@ -109,8 +109,7 @@ static void InitializeSpeedControl(SettingsWindow* dialog, QSpinBox* spinbox, QC QPushButton* reset_button, const char* setting_name, float default_value) { const SpeedControl control{dialog, spinbox, checkbox, setting_name, default_value}; - QObject::connect(spinbox, QOverload::of(&QSpinBox::valueChanged), spinbox, - [control](int) { OnSpeedControlValueChanged(control); }); + QObject::connect(spinbox, &QSpinBox::valueChanged, spinbox, [control](int) { OnSpeedControlValueChanged(control); }); QObject::connect(checkbox, &QCheckBox::checkStateChanged, checkbox, [control](Qt::CheckState state) { OnSpeedControlUnlimitedStateChanged(control, state); }); QObject::connect(reset_button, &QPushButton::clicked, reset_button, [control]() { ResetSpeedControlState(control); }); @@ -157,12 +156,9 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* dialog, QWidget connect(m_ui.rewindEnable, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::updateRewind); connect(m_ui.useSoftwareRendererForMemoryStates, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::updateRewind); - connect(m_ui.rewindSaveFrequency, QOverload::of(&QDoubleSpinBox::valueChanged), this, - &EmulationSettingsWidget::updateRewind); - connect(m_ui.rewindSaveSlots, QOverload::of(&QSpinBox::valueChanged), this, - &EmulationSettingsWidget::updateRewind); - connect(m_ui.runaheadFrames, QOverload::of(&QComboBox::currentIndexChanged), this, - &EmulationSettingsWidget::updateRewind); + connect(m_ui.rewindSaveFrequency, &QDoubleSpinBox::valueChanged, this, &EmulationSettingsWidget::updateRewind); + connect(m_ui.rewindSaveSlots, &QSpinBox::valueChanged, this, &EmulationSettingsWidget::updateRewind); + connect(m_ui.runaheadFrames, &QComboBox::currentIndexChanged, this, &EmulationSettingsWidget::updateRewind); dialog->registerWidgetHelp( m_ui.normalSpeed, tr("Emulation Speed"), "100%", diff --git a/src/duckstation-qt/interfacesettingswidget.cpp b/src/duckstation-qt/interfacesettingswidget.cpp index ea71eaf64..5aba1d8d2 100644 --- a/src/duckstation-qt/interfacesettingswidget.cpp +++ b/src/duckstation-qt/interfacesettingswidget.cpp @@ -104,8 +104,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget QCheckBox* const use_system_font = new QCheckBox(tr("Use System Font"), m_ui.appearanceGroup); SettingWidgetBinder::BindWidgetToBoolSetting(sif, use_system_font, "Main", "UseSystemFont", false); m_ui.appearanceLayout->addWidget(use_system_font, next_appearance_row, next_appearance_col++ * 2, 1, 2); - connect(use_system_font, &QCheckBox::checkStateChanged, this, &QtHost::UpdateApplicationTheme, - Qt::QueuedConnection); + connect(use_system_font, &QCheckBox::checkStateChanged, &QtHost::UpdateApplicationTheme); dialog->registerWidgetHelp( use_system_font, tr("Use System Font"), tr("Unchecked"), tr("Uses the system font for the interface, instead of the bundled Roboto font. Enabling " @@ -114,7 +113,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget m_disable_style_sheets = new QCheckBox(tr("Disable Style Sheets"), m_ui.appearanceGroup); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_disable_style_sheets, "Main", "DisableStylesheet", false); - connect(m_disable_style_sheets, &QCheckBox::checkStateChanged, this, &QtHost::UpdateApplicationTheme); + connect(m_disable_style_sheets, &QCheckBox::checkStateChanged, &QtHost::UpdateApplicationTheme); m_ui.appearanceLayout->addWidget(m_disable_style_sheets, next_appearance_row, next_appearance_col++ * 2, 1, 2); dialog->registerWidgetHelp(m_disable_style_sheets, tr("Disable Style Sheets"), tr("Unchecked"), tr("Disables the use of style sheets in the application, reverting to the original " @@ -279,7 +278,7 @@ void InterfaceSettingsWidget::setupThemeCombo(QComboBox* const cb) } SettingWidgetBinder::BindWidgetToStringSetting(nullptr, cb, "UI", "Theme", QtHost::GetDefaultThemeName()); - connect(cb, QOverload::of(&QComboBox::currentIndexChanged), cb, &QtHost::UpdateApplicationTheme); + connect(cb, &QComboBox::currentIndexChanged, &QtHost::UpdateApplicationTheme); } void InterfaceSettingsWidget::updateRenderToSeparateWindowOptions() diff --git a/src/duckstation-qt/memoryscannerwindow.cpp b/src/duckstation-qt/memoryscannerwindow.cpp index 0f721bc74..76698443b 100644 --- a/src/duckstation-qt/memoryscannerwindow.cpp +++ b/src/duckstation-qt/memoryscannerwindow.cpp @@ -115,19 +115,18 @@ void MemoryScannerWindow::connectUi() m_ui.scanSize->setCurrentIndex(static_cast(m_scanner.GetSize())); connect(m_ui.scanValue, &QLineEdit::textChanged, this, &MemoryScannerWindow::updateScanValue); - connect(m_ui.scanValueBase, QOverload::of(&QComboBox::currentIndexChanged), - [this](int index) { updateScanValue(); }); - connect(m_ui.scanSize, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + connect(m_ui.scanValueBase, &QComboBox::currentIndexChanged, [this](int index) { updateScanValue(); }); + connect(m_ui.scanSize, &QComboBox::currentIndexChanged, [this](int index) { m_scanner.SetSize(static_cast(index)); m_scanner.ResetSearch(); updateResults(); }); - connect(m_ui.scanValueSigned, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + connect(m_ui.scanValueSigned, &QComboBox::currentIndexChanged, [this](int index) { m_scanner.SetValueSigned(index == 0); m_scanner.ResetSearch(); updateResults(); }); - connect(m_ui.scanOperator, QOverload::of(&QComboBox::currentIndexChanged), + connect(m_ui.scanOperator, &QComboBox::currentIndexChanged, [this](int index) { m_scanner.SetOperator(static_cast(index)); }); connect(m_ui.scanStartAddress, &QLineEdit::textChanged, [this](const QString& value) { uint address; @@ -145,7 +144,7 @@ void MemoryScannerWindow::connectUi() address = value.toUInt(nullptr, 16); m_scanner.SetEndAddress(static_cast(address)); }); - connect(m_ui.scanPresetRange, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { + connect(m_ui.scanPresetRange, &QComboBox::currentIndexChanged, [this](int index) { if (index == 0) { m_ui.scanStartAddress->setText(formatHexValue(0, MemoryAccessSize::Word)); diff --git a/src/duckstation-qt/settingwidgetbinder.h b/src/duckstation-qt/settingwidgetbinder.h index 4d7354f55..7276f50a3 100644 --- a/src/duckstation-qt/settingwidgetbinder.h +++ b/src/duckstation-qt/settingwidgetbinder.h @@ -510,7 +510,7 @@ struct SettingAccessor { if (!isNullable(widget)) { - widget->connect(widget, QOverload::of(&QSpinBox::valueChanged), func); + widget->connect(widget, &QSpinBox::valueChanged, func); } else { @@ -539,7 +539,7 @@ struct SettingAccessor static void disconnect(QSpinBox* widget) { - QObject::disconnect(widget, QOverload::of(&QSpinBox::valueChanged), nullptr, nullptr); + QObject::disconnect(widget, &QSpinBox::valueChanged, nullptr, nullptr); if (isNullable(widget)) QObject::disconnect(widget, &QSpinBox::customContextMenuRequested, nullptr, nullptr); } @@ -646,7 +646,7 @@ struct SettingAccessor { if (!isNullable(widget)) { - widget->connect(widget, QOverload::of(&QDoubleSpinBox::valueChanged), func); + widget->connect(widget, &QDoubleSpinBox::valueChanged, func); } else { @@ -662,7 +662,7 @@ struct SettingAccessor }); menu->popup(widget->mapToGlobal(pt)); }); - widget->connect(widget, QOverload::of(&QDoubleSpinBox::valueChanged), widget, + widget->connect(widget, &QDoubleSpinBox::valueChanged, widget, [widget, func = std::move(func)]() { if (widget->property(IS_NULL_PROPERTY).toBool()) { @@ -676,7 +676,7 @@ struct SettingAccessor static void disconnect(QDoubleSpinBox* widget) { - QObject::disconnect(widget, QOverload::of(&QDoubleSpinBox::valueChanged), nullptr, nullptr); + QObject::disconnect(widget, &QDoubleSpinBox::valueChanged, nullptr, nullptr); if (isNullable(widget)) QObject::disconnect(widget, &QDoubleSpinBox::customContextMenuRequested, nullptr, nullptr); } diff --git a/src/duckstation-qt/setupwizarddialog.cpp b/src/duckstation-qt/setupwizarddialog.cpp index e8f414f01..b341f45fe 100644 --- a/src/duckstation-qt/setupwizarddialog.cpp +++ b/src/duckstation-qt/setupwizarddialog.cpp @@ -195,8 +195,7 @@ void SetupWizardDialog::setupLanguagePage(bool initial) SettingWidgetBinder::DisconnectWidget(m_ui.language); m_ui.language->clear(); InterfaceSettingsWidget::setupLanguageCombo(m_ui.language); - connect(m_ui.language, QOverload::of(&QComboBox::currentIndexChanged), this, - &SetupWizardDialog::languageChanged); + connect(m_ui.language, &QComboBox::currentIndexChanged, this, &SetupWizardDialog::languageChanged); if (initial) {