1
0
Эх сурвалжийг харах

UI: Replace SIGNAL and SLOT macros in frontend-tools

gxalpha 2 жил өмнө
parent
commit
34f871e605

+ 15 - 15
UI/frontend-plugins/frontend-tools/output-timer.cpp

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

+ 4 - 4
UI/frontend-plugins/frontend-tools/scripts.cpp

@@ -420,17 +420,17 @@ void ScriptsTool::on_scripts_customContextMenuRequested(const QPoint &pos)
 
 	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) {
 		popup.addSeparator();
 		popup.addAction(obs_module_text("Reload"), this,
-				SLOT(on_reloadScripts_clicked()));
+				&ScriptsTool::on_reloadScripts_clicked);
 		popup.addAction(obs_module_text("OpenFileLocation"), this,
-				SLOT(OpenScriptParentDirectory()));
+				&ScriptsTool::OpenScriptParentDirectory);
 		popup.addSeparator();
 		popup.addAction(tr("Remove"), this,
-				SLOT(on_removeScripts_clicked()));
+				&ScriptsTool::on_removeScripts_clicked);
 	}
 	obs_frontend_pop_ui_translation();