From 19115c84dd50105bb3a64df7e5017946247dcd46 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 30 Jul 2019 09:35:46 -0400 Subject: DolphinQt: Use qOverload where applicable Provides the same behvaior, but in a much more concise manner. --- Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp') diff --git a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp index 634c3fb17d..d35970288d 100644 --- a/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp +++ b/Source/Core/DolphinQt/NetPlay/NetPlaySetupDialog.cpp @@ -199,22 +199,21 @@ void NetPlaySetupDialog::CreateMainLayout() void NetPlaySetupDialog::ConnectWidgets() { - connect(m_connection_type, static_cast(&QComboBox::currentIndexChanged), - this, &NetPlaySetupDialog::OnConnectionTypeChanged); + connect(m_connection_type, qOverload(&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(&QSpinBox::valueChanged), this, + connect(m_connect_port_box, qOverload(&QSpinBox::valueChanged), this, &NetPlaySetupDialog::SaveSettings); // Host widget - connect(m_host_port_box, static_cast(&QSpinBox::valueChanged), this, + connect(m_host_port_box, qOverload(&QSpinBox::valueChanged), this, &NetPlaySetupDialog::SaveSettings); - connect(m_host_games, static_cast(&QListWidget::currentRowChanged), - [this](int index) { - Settings::GetQSettings().setValue(QStringLiteral("netplay/hostgame"), - m_host_games->item(index)->text()); - }); + connect(m_host_games, qOverload(&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(&QSpinBox::valueChanged), this, + connect(m_host_chunked_upload_limit_box, qOverload(&QSpinBox::valueChanged), this, &NetPlaySetupDialog::SaveSettings); connect(m_host_server_browser, &QCheckBox::toggled, this, &NetPlaySetupDialog::SaveSettings); -- cgit v1.2.3