mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
DolphinQt: Use qOverload where applicable
Provides the same behvaior, but in a much more concise manner.
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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 ||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user