2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

yuzu/debugger/graphics_surface: Clean up connection overload deduction

We can utilize qOverload with the signal connections to make the
function deducing a little less ugly.
This commit is contained in:
Lioncash 2019-04-05 19:26:39 -04:00
parent 9d296f8a35
commit bbeb859122

View file

@ -198,22 +198,20 @@ GraphicsSurfaceWidget::GraphicsSurfaceWidget(std::shared_ptr<Tegra::DebugContext
// Connections // Connections
connect(this, &GraphicsSurfaceWidget::Update, this, &GraphicsSurfaceWidget::OnUpdate); connect(this, &GraphicsSurfaceWidget::Update, this, &GraphicsSurfaceWidget::OnUpdate);
connect(surface_source_list, connect(surface_source_list, qOverload<int>(&QComboBox::currentIndexChanged), this,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&GraphicsSurfaceWidget::OnSurfaceSourceChanged); &GraphicsSurfaceWidget::OnSurfaceSourceChanged);
connect(surface_address_control, &CSpinBox::ValueChanged, this, connect(surface_address_control, &CSpinBox::ValueChanged, this,
&GraphicsSurfaceWidget::OnSurfaceAddressChanged); &GraphicsSurfaceWidget::OnSurfaceAddressChanged);
connect(surface_width_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), connect(surface_width_control, qOverload<int>(&QSpinBox::valueChanged), this,
this, &GraphicsSurfaceWidget::OnSurfaceWidthChanged); &GraphicsSurfaceWidget::OnSurfaceWidthChanged);
connect(surface_height_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), connect(surface_height_control, qOverload<int>(&QSpinBox::valueChanged), this,
this, &GraphicsSurfaceWidget::OnSurfaceHeightChanged); &GraphicsSurfaceWidget::OnSurfaceHeightChanged);
connect(surface_format_control, connect(surface_format_control, qOverload<int>(&QComboBox::currentIndexChanged), this,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&GraphicsSurfaceWidget::OnSurfaceFormatChanged); &GraphicsSurfaceWidget::OnSurfaceFormatChanged);
connect(surface_picker_x_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), connect(surface_picker_x_control, qOverload<int>(&QSpinBox::valueChanged), this,
this, &GraphicsSurfaceWidget::OnSurfacePickerXChanged); &GraphicsSurfaceWidget::OnSurfacePickerXChanged);
connect(surface_picker_y_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), connect(surface_picker_y_control, qOverload<int>(&QSpinBox::valueChanged), this,
this, &GraphicsSurfaceWidget::OnSurfacePickerYChanged); &GraphicsSurfaceWidget::OnSurfacePickerYChanged);
connect(save_surface, &QPushButton::clicked, this, &GraphicsSurfaceWidget::SaveSurface); connect(save_surface, &QPushButton::clicked, this, &GraphicsSurfaceWidget::SaveSurface);
auto main_widget = new QWidget; auto main_widget = new QWidget;