yuzu: Use Qt 5 signal/slots where applicable

Makes the signal/slot connections type-safe instead of string-based.
This commit is contained in:
Lioncash
2018-08-02 22:04:52 -04:00
parent a03c644aed
commit db340f6402
7 changed files with 49 additions and 46 deletions

View File

@@ -144,21 +144,25 @@ GraphicsBreakPointsWidget::GraphicsBreakPointsWidget(
qRegisterMetaType<Tegra::DebugContext::Event>("Tegra::DebugContext::Event");
connect(breakpoint_list, SIGNAL(doubleClicked(const QModelIndex&)), this,
SLOT(OnItemDoubleClicked(const QModelIndex&)));
connect(breakpoint_list, &QTreeView::doubleClicked, this,
&GraphicsBreakPointsWidget::OnItemDoubleClicked);
connect(resume_button, SIGNAL(clicked()), this, SLOT(OnResumeRequested()));
connect(resume_button, &QPushButton::clicked, this,
&GraphicsBreakPointsWidget::OnResumeRequested);
connect(this, SIGNAL(BreakPointHit(Tegra::DebugContext::Event, void*)), this,
SLOT(OnBreakPointHit(Tegra::DebugContext::Event, void*)), Qt::BlockingQueuedConnection);
connect(this, SIGNAL(Resumed()), this, SLOT(OnResumed()));
connect(this, &GraphicsBreakPointsWidget::BreakPointHit, this,
&GraphicsBreakPointsWidget::OnBreakPointHit, Qt::BlockingQueuedConnection);
connect(this, &GraphicsBreakPointsWidget::Resumed, this, &GraphicsBreakPointsWidget::OnResumed);
connect(this, SIGNAL(BreakPointHit(Tegra::DebugContext::Event, void*)), breakpoint_model,
SLOT(OnBreakPointHit(Tegra::DebugContext::Event)), Qt::BlockingQueuedConnection);
connect(this, SIGNAL(Resumed()), breakpoint_model, SLOT(OnResumed()));
connect(this, &GraphicsBreakPointsWidget::BreakPointHit, breakpoint_model,
&BreakPointModel::OnBreakPointHit, Qt::BlockingQueuedConnection);
connect(this, &GraphicsBreakPointsWidget::Resumed, breakpoint_model,
&BreakPointModel::OnResumed);
connect(this, SIGNAL(BreakPointsChanged(const QModelIndex&, const QModelIndex&)),
breakpoint_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
connect(this, &GraphicsBreakPointsWidget::BreakPointsChanged,
[this](const QModelIndex& top_left, const QModelIndex& bottom_right) {
breakpoint_model->dataChanged(top_left, bottom_right);
});
QWidget* main_widget = new QWidget;
auto main_layout = new QVBoxLayout;