DolphinQt: Use qOverload where applicable

Provides the same behvaior, but in a much more concise manner.
This commit is contained in:
Lioncash
2019-07-30 09:35:46 -04:00
committed by Léo Lam
parent 58de3c59ce
commit 19115c84dd
28 changed files with 96 additions and 127 deletions

View File

@ -386,9 +386,7 @@ void IOWindow::ConnectWidgets()
connect(m_button_box, &QDialogButtonBox::clicked, this, &IOWindow::OnDialogButtonPressed);
connect(m_devices_combo, &QComboBox::currentTextChanged, this, &IOWindow::OnDeviceChanged);
connect(m_range_spinbox, static_cast<void (QSpinBox::*)(int value)>(&QSpinBox::valueChanged),
this, &IOWindow::OnRangeChanged);
connect(m_range_slider, static_cast<void (QSlider::*)(int value)>(&QSlider::valueChanged), this,
connect(m_range_spinbox, qOverload<int>(&QSpinBox::valueChanged), this,
&IOWindow::OnRangeChanged);
connect(m_expression_text, &QPlainTextEdit::textChanged, [this] {
@ -396,7 +394,7 @@ void IOWindow::ConnectWidgets()
m_apply_button->setText(m_apply_button->text() + QStringLiteral("*"));
});
connect(m_operators_combo, QOverload<int>::of(&QComboBox::activated), [this](int index) {
connect(m_operators_combo, qOverload<int>(&QComboBox::activated), [this](int index) {
if (0 == index)
return;
@ -405,7 +403,7 @@ void IOWindow::ConnectWidgets()
m_operators_combo->setCurrentIndex(0);
});
connect(m_functions_combo, QOverload<int>::of(&QComboBox::activated), [this](int index) {
connect(m_functions_combo, qOverload<int>(&QComboBox::activated), [this](int index) {
if (0 == index)
return;

View File

@ -19,7 +19,7 @@ MappingDouble::MappingDouble(MappingWidget* parent, ControllerEmu::NumericSettin
if (const auto ui_description = m_setting.GetUIDescription())
setToolTip(tr(ui_description));
connect(this, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this,
connect(this, qOverload<double>(&QDoubleSpinBox::valueChanged), this,
[this, parent](double value) {
m_setting.SetValue(value);
ConfigChanged();

View File

@ -101,7 +101,7 @@ QGroupBox* MappingWidget::CreateGroupBox(const QString& name, ControllerEmu::Con
indicator_layout->setAlignment(Qt::AlignCenter);
form_layout->addRow(indicator_layout);
connect(this, &MappingWidget::Update, indicator, QOverload<>::of(&MappingIndicator::update));
connect(this, &MappingWidget::Update, indicator, qOverload<>(&MappingIndicator::update));
const bool need_calibration = group->type == ControllerEmu::GroupType::Cursor ||
group->type == ControllerEmu::GroupType::Stick ||

View File

@ -153,8 +153,8 @@ void MappingWindow::ConnectWidgets()
connect(&Settings::Instance(), &Settings::DevicesChanged, this,
&MappingWindow::OnGlobalDevicesChanged);
connect(this, &MappingWindow::ConfigChanged, this, &MappingWindow::OnGlobalDevicesChanged);
connect(m_devices_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &MappingWindow::OnSelectDevice);
connect(m_devices_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
&MappingWindow::OnSelectDevice);
connect(m_devices_refresh, &QPushButton::clicked, this, &MappingWindow::RefreshDevices);

View File

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