DolphinQt: Remove unnecessary qOverloads

qOverload is used to disambiguate pointers to overloaded functions, but
most of the usages in the code base were with non-overloaded functions.
This commit is contained in:
Dentomologist
2023-11-04 14:01:39 -07:00
parent b7b8f46832
commit 43e69d3e6a
33 changed files with 101 additions and 141 deletions

View File

@ -13,7 +13,7 @@ ConfigChoice::ConfigChoice(const QStringList& options, const Config::Info<int>&
: m_setting(setting)
{
addItems(options);
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &ConfigChoice::Update);
connect(this, &QComboBox::currentIndexChanged, this, &ConfigChoice::Update);
setCurrentIndex(Config::Get(m_setting));
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {

View File

@ -18,7 +18,7 @@ ConfigInteger::ConfigInteger(int minimum, int maximum, const Config::Info<int>&
setValue(Config::Get(setting));
connect(this, qOverload<int>(&ConfigInteger::valueChanged), this, &ConfigInteger::Update);
connect(this, &ConfigInteger::valueChanged, this, &ConfigInteger::Update);
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
QFont bf = font();
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);

View File

@ -215,12 +215,10 @@ void GameConfigWidget::ConnectWidgets()
m_use_dsp_hle, m_manual_texture_sampling, m_use_monoscopic_shadows})
connect(box, &QCheckBox::stateChanged, this, &GameConfigWidget::SaveSettings);
connect(m_deterministic_dual_core, qOverload<int>(&QComboBox::currentIndexChanged), this,
&GameConfigWidget::SaveSettings);
connect(m_depth_slider, qOverload<int>(&QSlider::valueChanged), this,
&GameConfigWidget::SaveSettings);
connect(m_convergence_spin, qOverload<int>(&QSpinBox::valueChanged), this,
connect(m_deterministic_dual_core, &QComboBox::currentIndexChanged, this,
&GameConfigWidget::SaveSettings);
connect(m_depth_slider, &QSlider::valueChanged, this, &GameConfigWidget::SaveSettings);
connect(m_convergence_spin, &QSpinBox::valueChanged, this, &GameConfigWidget::SaveSettings);
}
void GameConfigWidget::LoadCheckBox(QCheckBox* checkbox, const std::string& section,

View File

@ -108,11 +108,10 @@ void GamecubeControllersWidget::ConnectWidgets()
{
for (size_t i = 0; i < m_gc_controller_boxes.size(); ++i)
{
connect(m_gc_controller_boxes[i], qOverload<int>(&QComboBox::currentIndexChanged), this,
[this, i] {
OnGCTypeChanged(i);
SaveSettings();
});
connect(m_gc_controller_boxes[i], &QComboBox::currentIndexChanged, this, [this, i] {
OnGCTypeChanged(i);
SaveSettings();
});
connect(m_gc_buttons[i], &QPushButton::clicked, this, [this, i] { OnGCPadConfigure(i); });
}
}

View File

@ -228,15 +228,13 @@ void EnhancementsWidget::CreateWidgets()
void EnhancementsWidget::ConnectWidgets()
{
connect(m_aa_combo, qOverload<int>(&QComboBox::currentIndexChanged),
connect(m_aa_combo, &QComboBox::currentIndexChanged, [this](int) { SaveSettings(); });
connect(m_texture_filtering_combo, &QComboBox::currentIndexChanged,
[this](int) { SaveSettings(); });
connect(m_texture_filtering_combo, qOverload<int>(&QComboBox::currentIndexChanged),
connect(m_output_resampling_combo, &QComboBox::currentIndexChanged,
[this](int) { SaveSettings(); });
connect(m_output_resampling_combo, qOverload<int>(&QComboBox::currentIndexChanged),
[this](int) { SaveSettings(); });
connect(m_pp_effect, qOverload<int>(&QComboBox::currentIndexChanged),
[this](int) { SaveSettings(); });
connect(m_3d_mode, qOverload<int>(&QComboBox::currentIndexChanged), [this] {
connect(m_pp_effect, &QComboBox::currentIndexChanged, [this](int) { SaveSettings(); });
connect(m_3d_mode, &QComboBox::currentIndexChanged, [this] {
m_block_save = true;
m_configure_color_correction->setEnabled(g_Config.backend_info.bSupportsPostProcessing);
LoadPPShaders();

View File

@ -132,9 +132,8 @@ void GeneralWidget::CreateWidgets()
void GeneralWidget::ConnectWidgets()
{
// Video Backend
connect(m_backend_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&GeneralWidget::SaveSettings);
connect(m_adapter_combo, qOverload<int>(&QComboBox::currentIndexChanged), this, [&](int index) {
connect(m_backend_combo, &QComboBox::currentIndexChanged, this, &GeneralWidget::SaveSettings);
connect(m_adapter_combo, &QComboBox::currentIndexChanged, this, [&](int index) {
g_Config.iAdapter = index;
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
emit BackendChanged(QString::fromStdString(Config::Get(Config::MAIN_GFX_BACKEND)));

View File

@ -225,8 +225,7 @@ void InfoWidget::CreateLanguageSelector()
if (m_language_selector->count() == 1)
m_language_selector->setDisabled(true);
connect(m_language_selector, qOverload<int>(&QComboBox::currentIndexChanged), this,
&InfoWidget::ChangeLanguage);
connect(m_language_selector, &QComboBox::currentIndexChanged, this, &InfoWidget::ChangeLanguage);
}
void InfoWidget::ChangeLanguage()

View File

@ -163,8 +163,7 @@ void LogWidget::ConnectWidgets()
m_log_ring_buffer.clear();
});
connect(m_log_wrap, &QCheckBox::toggled, this, &LogWidget::SaveSettings);
connect(m_log_font, qOverload<int>(&QComboBox::currentIndexChanged), this,
&LogWidget::SaveSettings);
connect(m_log_font, &QComboBox::currentIndexChanged, this, &LogWidget::SaveSettings);
connect(this, &QDockWidget::topLevelChanged, this, &LogWidget::SaveSettings);
connect(&Settings::Instance(), &Settings::LogVisibilityChanged, this, &LogWidget::setVisible);
}

View File

@ -458,13 +458,12 @@ void IOWindow::ConnectWidgets()
connect(m_button_box, &QDialogButtonBox::clicked, this, &IOWindow::OnDialogButtonPressed);
connect(m_devices_combo, &QComboBox::currentTextChanged, this, &IOWindow::OnDeviceChanged);
connect(m_scalar_spinbox, qOverload<int>(&QSpinBox::valueChanged), this,
&IOWindow::OnRangeChanged);
connect(m_scalar_spinbox, &QSpinBox::valueChanged, this, &IOWindow::OnRangeChanged);
connect(m_expression_text, &QPlainTextEdit::textChanged,
[this] { UpdateExpression(m_expression_text->toPlainText().toStdString()); });
connect(m_variables_combo, qOverload<int>(&QComboBox::activated), [this](int index) {
connect(m_variables_combo, &QComboBox::activated, [this](int index) {
if (index == 0)
return;
@ -482,7 +481,7 @@ void IOWindow::ConnectWidgets()
m_variables_combo->setCurrentIndex(0);
});
connect(m_operators_combo, qOverload<int>(&QComboBox::activated), [this](int index) {
connect(m_operators_combo, &QComboBox::activated, [this](int index) {
if (index == 0)
return;
@ -491,7 +490,7 @@ void IOWindow::ConnectWidgets()
m_operators_combo->setCurrentIndex(0);
});
connect(m_functions_combo, qOverload<int>(&QComboBox::activated), [this](int index) {
connect(m_functions_combo, &QComboBox::activated, [this](int index) {
if (index == 0)
return;

View File

@ -18,12 +18,11 @@ MappingDouble::MappingDouble(MappingWidget* parent, ControllerEmu::NumericSettin
if (const auto ui_description = m_setting.GetUIDescription())
setToolTip(tr(ui_description));
connect(this, qOverload<double>(&QDoubleSpinBox::valueChanged), this,
[this, parent](double value) {
m_setting.SetValue(value);
ConfigChanged();
parent->SaveSettings();
});
connect(this, &QDoubleSpinBox::valueChanged, this, [this, parent](double value) {
m_setting.SetValue(value);
ConfigChanged();
parent->SaveSettings();
});
connect(parent, &MappingWidget::ConfigChanged, this, &MappingDouble::ConfigChanged);
connect(parent, &MappingWidget::Update, this, &MappingDouble::Update);

View File

@ -185,8 +185,7 @@ void MappingWindow::ConnectWidgets()
connect(&Settings::Instance(), &Settings::DevicesChanged, this,
&MappingWindow::OnGlobalDevicesChanged);
connect(this, &MappingWindow::ConfigChanged, this, &MappingWindow::OnGlobalDevicesChanged);
connect(m_devices_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&MappingWindow::OnSelectDevice);
connect(m_devices_combo, &QComboBox::currentIndexChanged, this, &MappingWindow::OnSelectDevice);
connect(m_reset_clear, &QPushButton::clicked, this, &MappingWindow::OnClearFieldsPressed);
connect(m_reset_default, &QPushButton::clicked, this, &MappingWindow::OnDefaultFieldsPressed);
@ -194,8 +193,7 @@ void MappingWindow::ConnectWidgets()
connect(m_profiles_load, &QPushButton::clicked, this, &MappingWindow::OnLoadProfilePressed);
connect(m_profiles_delete, &QPushButton::clicked, this, &MappingWindow::OnDeleteProfilePressed);
connect(m_profiles_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&MappingWindow::OnSelectProfile);
connect(m_profiles_combo, &QComboBox::currentIndexChanged, this, &MappingWindow::OnSelectProfile);
connect(m_profiles_combo, &QComboBox::editTextChanged, this,
&MappingWindow::OnProfileTextChanged);

View File

@ -76,10 +76,9 @@ void WiimoteEmuGeneral::CreateMainLayout()
void WiimoteEmuGeneral::Connect()
{
connect(m_extension_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
connect(m_extension_combo, &QComboBox::currentIndexChanged, this,
&WiimoteEmuGeneral::OnAttachmentChanged);
connect(m_extension_combo, qOverload<int>(&QComboBox::activated), this,
&WiimoteEmuGeneral::OnAttachmentSelected);
connect(m_extension_combo, &QComboBox::activated, this, &WiimoteEmuGeneral::OnAttachmentSelected);
connect(this, &MappingWidget::ConfigChanged, this, &WiimoteEmuGeneral::ConfigChanged);
connect(this, &MappingWidget::Update, this, &WiimoteEmuGeneral::Update);
}

View File

@ -87,7 +87,7 @@ void NewPatchDialog::CreateWidgets()
void NewPatchDialog::ConnectWidgets()
{
connect(m_name_edit, qOverload<const QString&>(&QLineEdit::textEdited),
connect(m_name_edit, &QLineEdit::textEdited,
[this](const QString& name) { m_patch.name = name.toStdString(); });
connect(m_add_button, &QPushButton::clicked, this, &NewPatchDialog::AddEntry);
@ -162,20 +162,17 @@ QGroupBox* NewPatchDialog::CreateEntry(const PatchEngine::PatchEntry& entry)
layout->addWidget(remove, 5, 0, 1, -1);
box->setLayout(layout);
connect(address, qOverload<const QString&>(&QLineEdit::textEdited),
[new_entry](const QString& text) {
new_entry->entry.address = OnTextEdited(new_entry->address, text);
});
connect(address, &QLineEdit::textEdited, [new_entry](const QString& text) {
new_entry->entry.address = OnTextEdited(new_entry->address, text);
});
connect(value, qOverload<const QString&>(&QLineEdit::textEdited),
[new_entry](const QString& text) {
new_entry->entry.value = OnTextEdited(new_entry->value, text);
});
connect(value, &QLineEdit::textEdited, [new_entry](const QString& text) {
new_entry->entry.value = OnTextEdited(new_entry->value, text);
});
connect(comparand, qOverload<const QString&>(&QLineEdit::textEdited),
[new_entry](const QString& text) {
new_entry->entry.comparand = OnTextEdited(new_entry->comparand, text);
});
connect(comparand, &QLineEdit::textEdited, [new_entry](const QString& text) {
new_entry->entry.comparand = OnTextEdited(new_entry->comparand, text);
});
connect(remove, &QPushButton::clicked, [this, box, new_entry] {
if (m_entries.size() > 1)

View File

@ -197,7 +197,7 @@ void WiimoteControllersWidget::ConnectWidgets()
for (size_t i = 0; i < m_wiimote_groups.size(); i++)
{
connect(m_wiimote_boxes[i], qOverload<int>(&QComboBox::currentIndexChanged), this, [this] {
connect(m_wiimote_boxes[i], &QComboBox::currentIndexChanged, this, [this] {
SaveSettings();
LoadSettings(Core::GetState());
});