mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
DolphinQt: Use qOverload where applicable
Provides the same behvaior, but in a much more concise manner.
This commit is contained in:
@ -199,22 +199,21 @@ void NetPlaySetupDialog::CreateMainLayout()
|
||||
|
||||
void NetPlaySetupDialog::ConnectWidgets()
|
||||
{
|
||||
connect(m_connection_type, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &NetPlaySetupDialog::OnConnectionTypeChanged);
|
||||
connect(m_connection_type, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||
&NetPlaySetupDialog::OnConnectionTypeChanged);
|
||||
connect(m_nickname_edit, &QLineEdit::textChanged, this, &NetPlaySetupDialog::SaveSettings);
|
||||
|
||||
// Connect widget
|
||||
connect(m_ip_edit, &QLineEdit::textChanged, this, &NetPlaySetupDialog::SaveSettings);
|
||||
connect(m_connect_port_box, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
connect(m_connect_port_box, qOverload<int>(&QSpinBox::valueChanged), this,
|
||||
&NetPlaySetupDialog::SaveSettings);
|
||||
// Host widget
|
||||
connect(m_host_port_box, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
connect(m_host_port_box, qOverload<int>(&QSpinBox::valueChanged), this,
|
||||
&NetPlaySetupDialog::SaveSettings);
|
||||
connect(m_host_games, static_cast<void (QListWidget::*)(int)>(&QListWidget::currentRowChanged),
|
||||
[this](int index) {
|
||||
Settings::GetQSettings().setValue(QStringLiteral("netplay/hostgame"),
|
||||
m_host_games->item(index)->text());
|
||||
});
|
||||
connect(m_host_games, qOverload<int>(&QListWidget::currentRowChanged), [this](int index) {
|
||||
Settings::GetQSettings().setValue(QStringLiteral("netplay/hostgame"),
|
||||
m_host_games->item(index)->text());
|
||||
});
|
||||
|
||||
connect(m_host_games, &QListWidget::itemDoubleClicked, this, &NetPlaySetupDialog::accept);
|
||||
|
||||
@ -224,8 +223,7 @@ void NetPlaySetupDialog::ConnectWidgets()
|
||||
m_host_chunked_upload_limit_box->setEnabled(value);
|
||||
SaveSettings();
|
||||
});
|
||||
connect(m_host_chunked_upload_limit_box,
|
||||
static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||
connect(m_host_chunked_upload_limit_box, qOverload<int>(&QSpinBox::valueChanged), this,
|
||||
&NetPlaySetupDialog::SaveSettings);
|
||||
|
||||
connect(m_host_server_browser, &QCheckBox::toggled, this, &NetPlaySetupDialog::SaveSettings);
|
||||
|
Reference in New Issue
Block a user