UI: Replace SIGNAL and SLOT macros in frontend-tools

This commit is contained in:
gxalpha 2023-04-06 04:14:25 +02:00
parent 0513e848d9
commit 34f871e605
No known key found for this signature in database
GPG Key ID: 470184116E317811
2 changed files with 19 additions and 19 deletions

View File

@ -20,12 +20,12 @@ OutputTimer::OutputTimer(QWidget *parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QObject::connect(ui->outputTimerStream, SIGNAL(clicked()), this, QObject::connect(ui->outputTimerStream, &QPushButton::clicked, this,
SLOT(StreamingTimerButton())); &OutputTimer::StreamingTimerButton);
QObject::connect(ui->outputTimerRecord, SIGNAL(clicked()), this, QObject::connect(ui->outputTimerRecord, &QPushButton::clicked, this,
SLOT(RecordingTimerButton())); &OutputTimer::RecordingTimerButton);
QObject::connect(ui->buttonBox->button(QDialogButtonBox::Close), QObject::connect(ui->buttonBox->button(QDialogButtonBox::Close),
SIGNAL(clicked()), this, SLOT(hide())); &QPushButton::clicked, this, &OutputTimer::hide);
streamingTimer = new QTimer(this); streamingTimer = new QTimer(this);
streamingTimerDisplay = new QTimer(this); streamingTimerDisplay = new QTimer(this);
@ -86,11 +86,11 @@ void OutputTimer::StreamTimerStart()
streamingTimer->setInterval(total); streamingTimer->setInterval(total);
streamingTimer->setSingleShot(true); streamingTimer->setSingleShot(true);
QObject::connect(streamingTimer, SIGNAL(timeout()), QObject::connect(streamingTimer, &QTimer::timeout, this,
SLOT(EventStopStreaming())); &OutputTimer::EventStopStreaming);
QObject::connect(streamingTimerDisplay, SIGNAL(timeout()), this, QObject::connect(streamingTimerDisplay, &QTimer::timeout, this,
SLOT(UpdateStreamTimerDisplay())); &OutputTimer::UpdateStreamTimerDisplay);
streamingTimer->start(); streamingTimer->start();
streamingTimerDisplay->start(1000); streamingTimerDisplay->start(1000);
@ -120,11 +120,11 @@ void OutputTimer::RecordTimerStart()
recordingTimer->setInterval(total); recordingTimer->setInterval(total);
recordingTimer->setSingleShot(true); recordingTimer->setSingleShot(true);
QObject::connect(recordingTimer, SIGNAL(timeout()), QObject::connect(recordingTimer, &QTimer::timeout, this,
SLOT(EventStopRecording())); &OutputTimer::EventStopRecording);
QObject::connect(recordingTimerDisplay, SIGNAL(timeout()), this, QObject::connect(recordingTimerDisplay, &QTimer::timeout, this,
SLOT(UpdateRecordTimerDisplay())); &OutputTimer::UpdateRecordTimerDisplay);
recordingTimer->start(); recordingTimer->start();
recordingTimerDisplay->start(1000); recordingTimerDisplay->start(1000);
@ -229,10 +229,10 @@ void OutputTimer::ShowHideDialog()
{ {
if (!isVisible()) { if (!isVisible()) {
setVisible(true); setVisible(true);
QTimer::singleShot(250, this, SLOT(show())); QTimer::singleShot(250, this, &OutputTimer::show);
} else { } else {
setVisible(false); setVisible(false);
QTimer::singleShot(250, this, SLOT(hide())); QTimer::singleShot(250, this, &OutputTimer::hide);
} }
} }

View File

@ -420,17 +420,17 @@ void ScriptsTool::on_scripts_customContextMenuRequested(const QPoint &pos)
obs_frontend_push_ui_translation(obs_module_get_string); obs_frontend_push_ui_translation(obs_module_get_string);
popup.addAction(tr("Add"), this, SLOT(on_addScripts_clicked())); popup.addAction(tr("Add"), this, &ScriptsTool::on_addScripts_clicked);
if (item) { if (item) {
popup.addSeparator(); popup.addSeparator();
popup.addAction(obs_module_text("Reload"), this, popup.addAction(obs_module_text("Reload"), this,
SLOT(on_reloadScripts_clicked())); &ScriptsTool::on_reloadScripts_clicked);
popup.addAction(obs_module_text("OpenFileLocation"), this, popup.addAction(obs_module_text("OpenFileLocation"), this,
SLOT(OpenScriptParentDirectory())); &ScriptsTool::OpenScriptParentDirectory);
popup.addSeparator(); popup.addSeparator();
popup.addAction(tr("Remove"), this, popup.addAction(tr("Remove"), this,
SLOT(on_removeScripts_clicked())); &ScriptsTool::on_removeScripts_clicked);
} }
obs_frontend_pop_ui_translation(); obs_frontend_pop_ui_translation();