mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-29 06:11:47 +00:00
Qt: Fix another usage of QObject::disconnect()
This commit is contained in:
parent
a5826ea6ae
commit
2e56f5d3ae
@ -154,10 +154,8 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(SettingsWindow* dialog, QWidget* pa
|
|||||||
&ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked);
|
&ConsoleSettingsWidget::onEnableCPUClockSpeedControlChecked);
|
||||||
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);
|
connect(m_ui.cpuClockSpeed, &QSlider::valueChanged, this, &ConsoleSettingsWidget::onCPUClockSpeedValueChanged);
|
||||||
|
|
||||||
SettingWidgetBinder::SetAvailability(m_ui.cpuExecutionModeLabel,
|
SettingWidgetBinder::SetAvailability(
|
||||||
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter));
|
m_ui.cpuExecutionMode, !m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter), m_ui.cpuExecutionModeLabel);
|
||||||
SettingWidgetBinder::SetAvailability(m_ui.cpuExecutionMode,
|
|
||||||
!m_dialog->hasGameTrait(GameDatabase::Trait::ForceInterpreter));
|
|
||||||
|
|
||||||
calculateCPUClockValue();
|
calculateCPUClockValue();
|
||||||
}
|
}
|
||||||
|
@ -1497,12 +1497,22 @@ static inline void BindWidgetToFolderSetting(SettingsInterface* sif, QLineEdit*
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename WidgetType>
|
template<typename WidgetType>
|
||||||
static inline void SetAvailability(WidgetType* widget, bool available)
|
static inline void DisconnectWidget(WidgetType* widget)
|
||||||
|
{
|
||||||
|
using Accessor = SettingAccessor<WidgetType>;
|
||||||
|
Accessor::disconnect(widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename WidgetType>
|
||||||
|
static inline void SetAvailability(WidgetType* widget, bool available, QLabel* widget_label = nullptr)
|
||||||
{
|
{
|
||||||
if (available)
|
if (available)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
widget->disconnect();
|
if (widget_label)
|
||||||
|
widget_label->setEnabled(false);
|
||||||
|
|
||||||
|
DisconnectWidget(widget);
|
||||||
|
|
||||||
if constexpr (std::is_same_v<WidgetType, QComboBox>)
|
if constexpr (std::is_same_v<WidgetType, QComboBox>)
|
||||||
{
|
{
|
||||||
@ -1530,11 +1540,4 @@ static inline void SetAvailability(WidgetType* widget, bool available)
|
|||||||
widget->setEnabled(false);
|
widget->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename WidgetType>
|
|
||||||
static inline void DisconnectWidget(WidgetType* widget)
|
|
||||||
{
|
|
||||||
using Accessor = SettingAccessor<WidgetType>;
|
|
||||||
Accessor::disconnect(widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace SettingWidgetBinder
|
} // namespace SettingWidgetBinder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user