citra_qt: Migrate to Qt 5 signal/slot connection syntax where applicable
This is more type-safe than the string-based signal/slot syntax that was being used. It also makes the connections throughout the UI code consistent.
This commit is contained in:
parent
4c3a4ab664
commit
a73f135868
|
@ -292,6 +292,6 @@ void GRenderWindow::showEvent(QShowEvent* event) {
|
||||||
QWidget::showEvent(event);
|
QWidget::showEvent(event);
|
||||||
|
|
||||||
// windowHandle() is not initialized until the Window is shown, so we connect it here.
|
// windowHandle() is not initialized until the Window is shown, so we connect it here.
|
||||||
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
|
connect(windowHandle(), &QWindow::screenChanged, this, &GRenderWindow::OnFramebufferSizeChanged,
|
||||||
SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
|
Qt::UniqueConnection);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,9 @@ ConfigureAudio::ConfigureAudio(QWidget* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
this->setConfiguration();
|
this->setConfiguration();
|
||||||
connect(ui->output_sink_combo_box, SIGNAL(currentIndexChanged(int)), this,
|
connect(ui->output_sink_combo_box,
|
||||||
SLOT(updateAudioDevices(int)));
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
|
&ConfigureAudio::updateAudioDevices);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigureAudio::~ConfigureAudio() {}
|
ConfigureAudio::~ConfigureAudio() {}
|
||||||
|
|
|
@ -10,7 +10,8 @@ extern GraphicsDebugger g_debugger;
|
||||||
|
|
||||||
GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent)
|
GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent)
|
||||||
: QAbstractListModel(parent), command_count(0) {
|
: QAbstractListModel(parent), command_count(0) {
|
||||||
connect(this, SIGNAL(GXCommandFinished(int)), this, SLOT(OnGXCommandFinishedInternal(int)));
|
connect(this, &GPUCommandStreamItemModel::GXCommandFinished, this,
|
||||||
|
&GPUCommandStreamItemModel::OnGXCommandFinishedInternal);
|
||||||
}
|
}
|
||||||
|
|
||||||
int GPUCommandStreamItemModel::rowCount(const QModelIndex& parent) const {
|
int GPUCommandStreamItemModel::rowCount(const QModelIndex& parent) const {
|
||||||
|
|
|
@ -10,12 +10,12 @@ BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr<Pica::DebugContex
|
||||||
: QDockWidget(title, parent), BreakPointObserver(debug_context) {
|
: QDockWidget(title, parent), BreakPointObserver(debug_context) {
|
||||||
qRegisterMetaType<Pica::DebugContext::Event>("Pica::DebugContext::Event");
|
qRegisterMetaType<Pica::DebugContext::Event>("Pica::DebugContext::Event");
|
||||||
|
|
||||||
connect(this, SIGNAL(Resumed()), this, SLOT(OnResumed()));
|
connect(this, &BreakPointObserverDock::Resumed, this, &BreakPointObserverDock::OnResumed);
|
||||||
|
|
||||||
// NOTE: This signal is emitted from a non-GUI thread, but connect() takes
|
// NOTE: This signal is emitted from a non-GUI thread, but connect() takes
|
||||||
// care of delaying its handling to the GUI thread.
|
// care of delaying its handling to the GUI thread.
|
||||||
connect(this, SIGNAL(BreakPointHit(Pica::DebugContext::Event, void*)), this,
|
connect(this, &BreakPointObserverDock::BreakPointHit, this,
|
||||||
SLOT(OnBreakPointHit(Pica::DebugContext::Event, void*)), Qt::BlockingQueuedConnection);
|
&BreakPointObserverDock::OnBreakPointHit, Qt::BlockingQueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakPointObserverDock::OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) {
|
void BreakPointObserverDock::OnPicaBreakPointHit(Pica::DebugContext::Event event, void* data) {
|
||||||
|
|
|
@ -145,21 +145,25 @@ GraphicsBreakPointsWidget::GraphicsBreakPointsWidget(
|
||||||
|
|
||||||
qRegisterMetaType<Pica::DebugContext::Event>("Pica::DebugContext::Event");
|
qRegisterMetaType<Pica::DebugContext::Event>("Pica::DebugContext::Event");
|
||||||
|
|
||||||
connect(breakpoint_list, SIGNAL(doubleClicked(const QModelIndex&)), this,
|
connect(breakpoint_list, &QTreeView::doubleClicked, this,
|
||||||
SLOT(OnItemDoubleClicked(const QModelIndex&)));
|
&GraphicsBreakPointsWidget::OnItemDoubleClicked);
|
||||||
|
|
||||||
connect(resume_button, SIGNAL(clicked()), this, SLOT(OnResumeRequested()));
|
connect(resume_button, &QPushButton::clicked, this,
|
||||||
|
&GraphicsBreakPointsWidget::OnResumeRequested);
|
||||||
|
|
||||||
connect(this, SIGNAL(BreakPointHit(Pica::DebugContext::Event, void*)), this,
|
connect(this, &GraphicsBreakPointsWidget::BreakPointHit, this,
|
||||||
SLOT(OnBreakPointHit(Pica::DebugContext::Event, void*)), Qt::BlockingQueuedConnection);
|
&GraphicsBreakPointsWidget::OnBreakPointHit, Qt::BlockingQueuedConnection);
|
||||||
connect(this, SIGNAL(Resumed()), this, SLOT(OnResumed()));
|
connect(this, &GraphicsBreakPointsWidget::Resumed, this, &GraphicsBreakPointsWidget::OnResumed);
|
||||||
|
|
||||||
connect(this, SIGNAL(BreakPointHit(Pica::DebugContext::Event, void*)), breakpoint_model,
|
connect(this, &GraphicsBreakPointsWidget::BreakPointHit, breakpoint_model,
|
||||||
SLOT(OnBreakPointHit(Pica::DebugContext::Event)), Qt::BlockingQueuedConnection);
|
&BreakPointModel::OnBreakPointHit, Qt::BlockingQueuedConnection);
|
||||||
connect(this, SIGNAL(Resumed()), breakpoint_model, SLOT(OnResumed()));
|
connect(this, &GraphicsBreakPointsWidget::Resumed, breakpoint_model,
|
||||||
|
&BreakPointModel::OnResumed);
|
||||||
|
|
||||||
connect(this, SIGNAL(BreakPointsChanged(const QModelIndex&, const QModelIndex&)),
|
connect(this, &GraphicsBreakPointsWidget::BreakPointsChanged,
|
||||||
breakpoint_model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)));
|
[this](const QModelIndex& top_left, const QModelIndex& bottom_right) {
|
||||||
|
breakpoint_model->dataChanged(top_left, bottom_right);
|
||||||
|
});
|
||||||
|
|
||||||
QWidget* main_widget = new QWidget;
|
QWidget* main_widget = new QWidget;
|
||||||
auto main_layout = new QVBoxLayout;
|
auto main_layout = new QVBoxLayout;
|
||||||
|
|
|
@ -194,20 +194,19 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent)
|
||||||
list_widget->setUniformRowHeights(true);
|
list_widget->setUniformRowHeights(true);
|
||||||
list_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
list_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
|
|
||||||
connect(list_widget->selectionModel(),
|
connect(list_widget->selectionModel(), &QItemSelectionModel::currentChanged, this,
|
||||||
SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), this,
|
&GPUCommandListWidget::SetCommandInfo);
|
||||||
SLOT(SetCommandInfo(const QModelIndex&)));
|
connect(list_widget, &QTreeView::doubleClicked, this,
|
||||||
connect(list_widget, SIGNAL(doubleClicked(const QModelIndex&)), this,
|
&GPUCommandListWidget::OnCommandDoubleClicked);
|
||||||
SLOT(OnCommandDoubleClicked(const QModelIndex&)));
|
|
||||||
|
|
||||||
toggle_tracing = new QPushButton(tr("Start Tracing"));
|
toggle_tracing = new QPushButton(tr("Start Tracing"));
|
||||||
QPushButton* copy_all = new QPushButton(tr("Copy All"));
|
QPushButton* copy_all = new QPushButton(tr("Copy All"));
|
||||||
|
|
||||||
connect(toggle_tracing, SIGNAL(clicked()), this, SLOT(OnToggleTracing()));
|
connect(toggle_tracing, &QPushButton::clicked, this, &GPUCommandListWidget::OnToggleTracing);
|
||||||
connect(this, SIGNAL(TracingFinished(const Pica::DebugUtils::PicaTrace&)), model,
|
connect(this, &GPUCommandListWidget::TracingFinished, model,
|
||||||
SLOT(OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&)));
|
&GPUCommandListModel::OnPicaTraceFinished);
|
||||||
|
|
||||||
connect(copy_all, SIGNAL(clicked()), this, SLOT(CopyAllToClipboard()));
|
connect(copy_all, &QPushButton::clicked, this, &GPUCommandListWidget::CopyAllToClipboard);
|
||||||
|
|
||||||
command_info_widget = nullptr;
|
command_info_widget = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -118,22 +118,24 @@ GraphicsSurfaceWidget::GraphicsSurfaceWidget(std::shared_ptr<Pica::DebugContext>
|
||||||
save_surface = new QPushButton(QIcon::fromTheme("document-save"), tr("Save"));
|
save_surface = new QPushButton(QIcon::fromTheme("document-save"), tr("Save"));
|
||||||
|
|
||||||
// Connections
|
// Connections
|
||||||
connect(this, SIGNAL(Update()), this, SLOT(OnUpdate()));
|
connect(this, &GraphicsSurfaceWidget::Update, this, &GraphicsSurfaceWidget::OnUpdate);
|
||||||
connect(surface_source_list, SIGNAL(currentIndexChanged(int)), this,
|
connect(surface_source_list,
|
||||||
SLOT(OnSurfaceSourceChanged(int)));
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
connect(surface_address_control, SIGNAL(ValueChanged(qint64)), this,
|
&GraphicsSurfaceWidget::OnSurfaceSourceChanged);
|
||||||
SLOT(OnSurfaceAddressChanged(qint64)));
|
connect(surface_address_control, &CSpinBox::ValueChanged, this,
|
||||||
connect(surface_width_control, SIGNAL(valueChanged(int)), this,
|
&GraphicsSurfaceWidget::OnSurfaceAddressChanged);
|
||||||
SLOT(OnSurfaceWidthChanged(int)));
|
connect(surface_width_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
connect(surface_height_control, SIGNAL(valueChanged(int)), this,
|
this, &GraphicsSurfaceWidget::OnSurfaceWidthChanged);
|
||||||
SLOT(OnSurfaceHeightChanged(int)));
|
connect(surface_height_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
connect(surface_format_control, SIGNAL(currentIndexChanged(int)), this,
|
this, &GraphicsSurfaceWidget::OnSurfaceHeightChanged);
|
||||||
SLOT(OnSurfaceFormatChanged(int)));
|
connect(surface_format_control,
|
||||||
connect(surface_picker_x_control, SIGNAL(valueChanged(int)), this,
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
SLOT(OnSurfacePickerXChanged(int)));
|
&GraphicsSurfaceWidget::OnSurfaceFormatChanged);
|
||||||
connect(surface_picker_y_control, SIGNAL(valueChanged(int)), this,
|
connect(surface_picker_x_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
SLOT(OnSurfacePickerYChanged(int)));
|
this, &GraphicsSurfaceWidget::OnSurfacePickerXChanged);
|
||||||
connect(save_surface, SIGNAL(clicked()), this, SLOT(SaveSurface()));
|
connect(surface_picker_y_control, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
|
||||||
|
this, &GraphicsSurfaceWidget::OnSurfacePickerYChanged);
|
||||||
|
connect(save_surface, &QPushButton::clicked, this, &GraphicsSurfaceWidget::SaveSurface);
|
||||||
|
|
||||||
auto main_widget = new QWidget;
|
auto main_widget = new QWidget;
|
||||||
auto main_layout = new QVBoxLayout;
|
auto main_layout = new QVBoxLayout;
|
||||||
|
|
|
@ -31,15 +31,15 @@ GraphicsTracingWidget::GraphicsTracingWidget(std::shared_ptr<Pica::DebugContext>
|
||||||
new QPushButton(QIcon::fromTheme("document-save"), tr("Stop and Save"));
|
new QPushButton(QIcon::fromTheme("document-save"), tr("Stop and Save"));
|
||||||
QPushButton* abort_recording = new QPushButton(tr("Abort Recording"));
|
QPushButton* abort_recording = new QPushButton(tr("Abort Recording"));
|
||||||
|
|
||||||
connect(this, SIGNAL(SetStartTracingButtonEnabled(bool)), start_recording,
|
connect(this, &GraphicsTracingWidget::SetStartTracingButtonEnabled, start_recording,
|
||||||
SLOT(setVisible(bool)));
|
&QPushButton::setVisible);
|
||||||
connect(this, SIGNAL(SetStopTracingButtonEnabled(bool)), stop_recording,
|
connect(this, &GraphicsTracingWidget::SetStopTracingButtonEnabled, stop_recording,
|
||||||
SLOT(setVisible(bool)));
|
&QPushButton::setVisible);
|
||||||
connect(this, SIGNAL(SetAbortTracingButtonEnabled(bool)), abort_recording,
|
connect(this, &GraphicsTracingWidget::SetAbortTracingButtonEnabled, abort_recording,
|
||||||
SLOT(setVisible(bool)));
|
&QPushButton::setVisible);
|
||||||
connect(start_recording, SIGNAL(clicked()), this, SLOT(StartRecording()));
|
connect(start_recording, &QPushButton::clicked, this, &GraphicsTracingWidget::StartRecording);
|
||||||
connect(stop_recording, SIGNAL(clicked()), this, SLOT(StopRecording()));
|
connect(stop_recording, &QPushButton::clicked, this, &GraphicsTracingWidget::StopRecording);
|
||||||
connect(abort_recording, SIGNAL(clicked()), this, SLOT(AbortRecording()));
|
connect(abort_recording, &QPushButton::clicked, this, &GraphicsTracingWidget::AbortRecording);
|
||||||
|
|
||||||
stop_recording->setVisible(false);
|
stop_recording->setVisible(false);
|
||||||
abort_recording->setVisible(false);
|
abort_recording->setVisible(false);
|
||||||
|
|
|
@ -393,15 +393,18 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(
|
||||||
|
|
||||||
cycle_index = new QSpinBox;
|
cycle_index = new QSpinBox;
|
||||||
|
|
||||||
connect(dump_shader, SIGNAL(clicked()), this, SLOT(DumpShader()));
|
connect(dump_shader, &QPushButton::clicked, this, &GraphicsVertexShaderWidget::DumpShader);
|
||||||
|
|
||||||
connect(cycle_index, SIGNAL(valueChanged(int)), this, SLOT(OnCycleIndexChanged(int)));
|
connect(cycle_index, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this,
|
||||||
|
&GraphicsVertexShaderWidget::OnCycleIndexChanged);
|
||||||
|
|
||||||
for (unsigned i = 0; i < ARRAY_SIZE(input_data); ++i) {
|
for (unsigned i = 0; i < ARRAY_SIZE(input_data); ++i) {
|
||||||
connect(input_data[i], SIGNAL(textEdited(const QString&)), input_data_mapper, SLOT(map()));
|
connect(input_data[i], &QLineEdit::textEdited, input_data_mapper,
|
||||||
|
static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
|
||||||
input_data_mapper->setMapping(input_data[i], i);
|
input_data_mapper->setMapping(input_data[i], i);
|
||||||
}
|
}
|
||||||
connect(input_data_mapper, SIGNAL(mapped(int)), this, SLOT(OnInputAttributeChanged(int)));
|
connect(input_data_mapper, static_cast<void (QSignalMapper::*)(int)>(&QSignalMapper::mapped),
|
||||||
|
this, &GraphicsVertexShaderWidget::OnInputAttributeChanged);
|
||||||
|
|
||||||
auto main_widget = new QWidget;
|
auto main_widget = new QWidget;
|
||||||
auto main_layout = new QVBoxLayout;
|
auto main_layout = new QVBoxLayout;
|
||||||
|
|
|
@ -74,7 +74,7 @@ QAction* MicroProfileDialog::toggleViewAction() {
|
||||||
toggle_view_action = new QAction(windowTitle(), this);
|
toggle_view_action = new QAction(windowTitle(), this);
|
||||||
toggle_view_action->setCheckable(true);
|
toggle_view_action->setCheckable(true);
|
||||||
toggle_view_action->setChecked(isVisible());
|
toggle_view_action->setChecked(isVisible());
|
||||||
connect(toggle_view_action, SIGNAL(toggled(bool)), SLOT(setVisible(bool)));
|
connect(toggle_view_action, &QAction::toggled, this, &MicroProfileDialog::setVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
return toggle_view_action;
|
return toggle_view_action;
|
||||||
|
@ -107,7 +107,8 @@ MicroProfileWidget::MicroProfileWidget(QWidget* parent) : QWidget(parent) {
|
||||||
MicroProfileSetDisplayMode(1); // Timers screen
|
MicroProfileSetDisplayMode(1); // Timers screen
|
||||||
MicroProfileInitUI();
|
MicroProfileInitUI();
|
||||||
|
|
||||||
connect(&update_timer, SIGNAL(timeout()), SLOT(update()));
|
connect(&update_timer, &QTimer::timeout, this,
|
||||||
|
static_cast<void (MicroProfileWidget::*)()>(&MicroProfileWidget::update));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MicroProfileWidget::paintEvent(QPaintEvent* ev) {
|
void MicroProfileWidget::paintEvent(QPaintEvent* ev) {
|
||||||
|
|
|
@ -124,8 +124,7 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} {
|
||||||
edit_filter->setPlaceholderText(tr("Enter pattern to filter"));
|
edit_filter->setPlaceholderText(tr("Enter pattern to filter"));
|
||||||
edit_filter->installEventFilter(keyReleaseEater);
|
edit_filter->installEventFilter(keyReleaseEater);
|
||||||
edit_filter->setClearButtonEnabled(true);
|
edit_filter->setClearButtonEnabled(true);
|
||||||
connect(edit_filter, SIGNAL(textChanged(const QString&)), parent,
|
connect(edit_filter, &QLineEdit::textChanged, parent, &GameList::onTextChanged);
|
||||||
SLOT(onTextChanged(const QString&)));
|
|
||||||
label_filter_result = new QLabel;
|
label_filter_result = new QLabel;
|
||||||
button_filter_close = new QToolButton(this);
|
button_filter_close = new QToolButton(this);
|
||||||
button_filter_close->setText("X");
|
button_filter_close->setText("X");
|
||||||
|
@ -134,7 +133,7 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} {
|
||||||
"#000000; font-weight: bold; background: #F0F0F0; }"
|
"#000000; font-weight: bold; background: #F0F0F0; }"
|
||||||
"QToolButton:hover{ border: none; padding: 0px; color: "
|
"QToolButton:hover{ border: none; padding: 0px; color: "
|
||||||
"#EEEEEE; font-weight: bold; background: #E81123}");
|
"#EEEEEE; font-weight: bold; background: #E81123}");
|
||||||
connect(button_filter_close, SIGNAL(clicked()), parent, SLOT(onFilterCloseClicked()));
|
connect(button_filter_close, &QToolButton::clicked, parent, &GameList::onFilterCloseClicked);
|
||||||
layout_filter->setSpacing(10);
|
layout_filter->setSpacing(10);
|
||||||
layout_filter->addWidget(label_filter);
|
layout_filter->addWidget(label_filter);
|
||||||
layout_filter->addWidget(edit_filter);
|
layout_filter->addWidget(edit_filter);
|
||||||
|
|
|
@ -252,7 +252,7 @@ void GMainWindow::InitializeRecentFileMenuActions() {
|
||||||
for (int i = 0; i < max_recent_files_item; ++i) {
|
for (int i = 0; i < max_recent_files_item; ++i) {
|
||||||
actions_recent_files[i] = new QAction(this);
|
actions_recent_files[i] = new QAction(this);
|
||||||
actions_recent_files[i]->setVisible(false);
|
actions_recent_files[i]->setVisible(false);
|
||||||
connect(actions_recent_files[i], SIGNAL(triggered()), this, SLOT(OnMenuRecentFile()));
|
connect(actions_recent_files[i], &QAction::triggered, this, &GMainWindow::OnMenuRecentFile);
|
||||||
|
|
||||||
ui.menu_recent_files->addAction(actions_recent_files[i]);
|
ui.menu_recent_files->addAction(actions_recent_files[i]);
|
||||||
}
|
}
|
||||||
|
@ -269,12 +269,12 @@ void GMainWindow::InitializeHotkeys() {
|
||||||
Qt::ApplicationShortcut);
|
Qt::ApplicationShortcut);
|
||||||
LoadHotkeys();
|
LoadHotkeys();
|
||||||
|
|
||||||
connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this,
|
connect(GetHotkey("Main Window", "Load File", this), &QShortcut::activated, this,
|
||||||
SLOT(OnMenuLoadFile()));
|
&GMainWindow::OnMenuLoadFile);
|
||||||
connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this,
|
connect(GetHotkey("Main Window", "Start Emulation", this), &QShortcut::activated, this,
|
||||||
SLOT(OnStartGame()));
|
&GMainWindow::OnStartGame);
|
||||||
connect(GetHotkey("Main Window", "Swap Screens", render_window), SIGNAL(activated()), this,
|
connect(GetHotkey("Main Window", "Swap Screens", render_window), &QShortcut::activated, this,
|
||||||
SLOT(OnSwapScreens()));
|
&GMainWindow::OnSwapScreens);
|
||||||
connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated,
|
connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activated,
|
||||||
ui.action_Fullscreen, &QAction::trigger);
|
ui.action_Fullscreen, &QAction::trigger);
|
||||||
connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously,
|
connect(GetHotkey("Main Window", "Fullscreen", render_window), &QShortcut::activatedAmbiguously,
|
||||||
|
@ -333,13 +333,14 @@ void GMainWindow::RestoreUIState() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::ConnectWidgetEvents() {
|
void GMainWindow::ConnectWidgetEvents() {
|
||||||
connect(game_list, SIGNAL(GameChosen(QString)), this, SLOT(OnGameListLoadFile(QString)));
|
connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile);
|
||||||
connect(game_list, SIGNAL(OpenSaveFolderRequested(u64)), this,
|
connect(game_list, &GameList::OpenSaveFolderRequested, this,
|
||||||
SLOT(OnGameListOpenSaveFolder(u64)));
|
&GMainWindow::OnGameListOpenSaveFolder);
|
||||||
|
|
||||||
connect(this, SIGNAL(EmulationStarting(EmuThread*)), render_window,
|
connect(this, &GMainWindow::EmulationStarting, render_window,
|
||||||
SLOT(OnEmulationStarting(EmuThread*)));
|
&GRenderWindow::OnEmulationStarting);
|
||||||
connect(this, SIGNAL(EmulationStopping()), render_window, SLOT(OnEmulationStopping()));
|
connect(this, &GMainWindow::EmulationStopping, render_window,
|
||||||
|
&GRenderWindow::OnEmulationStopping);
|
||||||
|
|
||||||
connect(&status_bar_update_timer, &QTimer::timeout, this, &GMainWindow::UpdateStatusBar);
|
connect(&status_bar_update_timer, &QTimer::timeout, this, &GMainWindow::UpdateStatusBar);
|
||||||
|
|
||||||
|
@ -560,17 +561,17 @@ void GMainWindow::BootGame(const QString& filename) {
|
||||||
render_window->moveContext();
|
render_window->moveContext();
|
||||||
emu_thread->start();
|
emu_thread->start();
|
||||||
|
|
||||||
connect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
|
connect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
|
||||||
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
|
// BlockingQueuedConnection is important here, it makes sure we've finished refreshing our views
|
||||||
// before the CPU continues
|
// before the CPU continues
|
||||||
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), registersWidget,
|
connect(emu_thread.get(), &EmuThread::DebugModeEntered, registersWidget,
|
||||||
SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
|
&RegistersWidget::OnDebugModeEntered, Qt::BlockingQueuedConnection);
|
||||||
connect(emu_thread.get(), SIGNAL(DebugModeEntered()), waitTreeWidget,
|
connect(emu_thread.get(), &EmuThread::DebugModeEntered, waitTreeWidget,
|
||||||
SLOT(OnDebugModeEntered()), Qt::BlockingQueuedConnection);
|
&WaitTreeWidget::OnDebugModeEntered, Qt::BlockingQueuedConnection);
|
||||||
connect(emu_thread.get(), SIGNAL(DebugModeLeft()), registersWidget, SLOT(OnDebugModeLeft()),
|
connect(emu_thread.get(), &EmuThread::DebugModeLeft, registersWidget,
|
||||||
Qt::BlockingQueuedConnection);
|
&RegistersWidget::OnDebugModeLeft, Qt::BlockingQueuedConnection);
|
||||||
connect(emu_thread.get(), SIGNAL(DebugModeLeft()), waitTreeWidget, SLOT(OnDebugModeLeft()),
|
connect(emu_thread.get(), &EmuThread::DebugModeLeft, waitTreeWidget,
|
||||||
Qt::BlockingQueuedConnection);
|
&WaitTreeWidget::OnDebugModeLeft, Qt::BlockingQueuedConnection);
|
||||||
|
|
||||||
// Update the GUI
|
// Update the GUI
|
||||||
registersWidget->OnDebugModeEntered();
|
registersWidget->OnDebugModeEntered();
|
||||||
|
@ -606,7 +607,7 @@ void GMainWindow::ShutdownGame() {
|
||||||
emu_thread = nullptr;
|
emu_thread = nullptr;
|
||||||
|
|
||||||
// The emulation is stopped, so closing the window or not does not matter anymore
|
// The emulation is stopped, so closing the window or not does not matter anymore
|
||||||
disconnect(render_window, SIGNAL(Closed()), this, SLOT(OnStopGame()));
|
disconnect(render_window, &GRenderWindow::Closed, this, &GMainWindow::OnStopGame);
|
||||||
|
|
||||||
// Update the GUI
|
// Update the GUI
|
||||||
ui.action_Start->setEnabled(false);
|
ui.action_Start->setEnabled(false);
|
||||||
|
@ -787,8 +788,7 @@ void GMainWindow::OnStartGame() {
|
||||||
emu_thread->SetRunning(true);
|
emu_thread->SetRunning(true);
|
||||||
qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus");
|
qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus");
|
||||||
qRegisterMetaType<std::string>("std::string");
|
qRegisterMetaType<std::string>("std::string");
|
||||||
connect(emu_thread.get(), SIGNAL(ErrorThrown(Core::System::ResultStatus, std::string)), this,
|
connect(emu_thread.get(), &EmuThread::ErrorThrown, this, &GMainWindow::OnCoreError);
|
||||||
SLOT(OnCoreError(Core::System::ResultStatus, std::string)));
|
|
||||||
|
|
||||||
ui.action_Start->setEnabled(false);
|
ui.action_Start->setEnabled(false);
|
||||||
ui.action_Start->setText(tr("Continue"));
|
ui.action_Start->setText(tr("Continue"));
|
||||||
|
|
|
@ -39,7 +39,7 @@ CSpinBox::CSpinBox(QWidget* parent)
|
||||||
// TODO: Might be nice to not immediately call the slot.
|
// TODO: Might be nice to not immediately call the slot.
|
||||||
// Think of an address that is being replaced by a different one, in which case a lot
|
// Think of an address that is being replaced by a different one, in which case a lot
|
||||||
// invalid intermediate addresses would be read from during editing.
|
// invalid intermediate addresses would be read from during editing.
|
||||||
connect(lineEdit(), SIGNAL(textEdited(QString)), this, SLOT(OnEditingFinished()));
|
connect(lineEdit(), &QLineEdit::textEdited, this, &CSpinBox::OnEditingFinished);
|
||||||
|
|
||||||
UpdateText();
|
UpdateText();
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue