mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
DolphinQt: Use qOverload where applicable
Provides the same behvaior, but in a much more concise manner.
This commit is contained in:
@ -144,18 +144,17 @@ void EnhancementsWidget::CreateWidgets()
|
||||
|
||||
void EnhancementsWidget::ConnectWidgets()
|
||||
{
|
||||
connect(m_aa_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
connect(m_aa_combo, qOverload<int>(&QComboBox::currentIndexChanged),
|
||||
[this](int) { SaveSettings(); });
|
||||
connect(m_pp_effect, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
connect(m_pp_effect, qOverload<int>(&QComboBox::currentIndexChanged),
|
||||
[this](int) { SaveSettings(); });
|
||||
connect(m_3d_mode, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
[this] {
|
||||
m_block_save = true;
|
||||
LoadPPShaders();
|
||||
m_block_save = false;
|
||||
connect(m_3d_mode, qOverload<int>(&QComboBox::currentIndexChanged), [this] {
|
||||
m_block_save = true;
|
||||
LoadPPShaders();
|
||||
m_block_save = false;
|
||||
|
||||
SaveSettings();
|
||||
});
|
||||
SaveSettings();
|
||||
});
|
||||
connect(m_configure_pp_effect, &QPushButton::clicked, this,
|
||||
&EnhancementsWidget::ConfigurePostProcessingShader);
|
||||
}
|
||||
|
@ -138,13 +138,12 @@ void GeneralWidget::CreateWidgets()
|
||||
void GeneralWidget::ConnectWidgets()
|
||||
{
|
||||
// Video Backend
|
||||
connect(m_backend_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &GeneralWidget::SaveSettings);
|
||||
connect(m_adapter_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, [](int index) {
|
||||
g_Config.iAdapter = index;
|
||||
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
|
||||
});
|
||||
connect(m_backend_combo, qOverload<int>(&QComboBox::currentIndexChanged), this,
|
||||
&GeneralWidget::SaveSettings);
|
||||
connect(m_adapter_combo, qOverload<int>(&QComboBox::currentIndexChanged), this, [](int index) {
|
||||
g_Config.iAdapter = index;
|
||||
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
|
||||
});
|
||||
}
|
||||
|
||||
void GeneralWidget::LoadSettings()
|
||||
|
@ -14,8 +14,7 @@ GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::ConfigI
|
||||
: m_setting(setting)
|
||||
{
|
||||
addItems(options);
|
||||
connect(this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||
&GraphicsChoice::Update);
|
||||
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &GraphicsChoice::Update);
|
||||
setCurrentIndex(Config::Get(m_setting));
|
||||
|
||||
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
|
||||
|
@ -20,9 +20,7 @@ GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::ConfigI
|
||||
|
||||
setValue(Config::Get(setting));
|
||||
|
||||
connect(this, static_cast<void (GraphicsInteger::*)(int)>(&GraphicsInteger::valueChanged), this,
|
||||
&GraphicsInteger::Update);
|
||||
|
||||
connect(this, qOverload<int>(&GraphicsInteger::valueChanged), this, &GraphicsInteger::Update);
|
||||
connect(&Settings::Instance(), &Settings::ConfigChanged, [this] {
|
||||
QFont bf = font();
|
||||
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
|
||||
|
@ -111,11 +111,11 @@ void SoftwareRendererWidget::CreateWidgets()
|
||||
|
||||
void SoftwareRendererWidget::ConnectWidgets()
|
||||
{
|
||||
connect(m_backend_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
connect(m_backend_combo, qOverload<int>(&QComboBox::currentIndexChanged),
|
||||
[this](int) { SaveSettings(); });
|
||||
connect(m_object_range_min, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||
connect(m_object_range_min, qOverload<int>(&QSpinBox::valueChanged),
|
||||
[this](int) { SaveSettings(); });
|
||||
connect(m_object_range_max, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||
connect(m_object_range_max, qOverload<int>(&QSpinBox::valueChanged),
|
||||
[this](int) { SaveSettings(); });
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user