Connection syntax migration (#637)

This commit is contained in:
Jonas Kvinge
2021-01-26 16:48:04 +01:00
committed by GitHub
parent d57f6303f4
commit bf7c8df353
362 changed files with 2452 additions and 2434 deletions

View File

@@ -83,7 +83,7 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
AddAnalyzerType<Rainbow::NyanCatAnalyzer>();
AddAnalyzerType<Rainbow::RainbowDashAnalyzer>();
disable_action_ = context_menu_->addAction(tr("No analyzer"), this, SLOT(DisableAnalyzer()));
disable_action_ = context_menu_->addAction(tr("No analyzer"), this, &AnalyzerContainer::DisableAnalyzer);
disable_action_->setCheckable(true);
group_->addAction(disable_action_);
@@ -91,7 +91,7 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
double_click_timer_->setSingleShot(true);
double_click_timer_->setInterval(250);
connect(double_click_timer_, SIGNAL(timeout()), SLOT(ShowPopupMenu()));
QObject::connect(double_click_timer_, &QTimer::timeout, this, &AnalyzerContainer::ShowPopupMenu);
Load();
@@ -131,7 +131,7 @@ void AnalyzerContainer::DisableAnalyzer() {
Save();
}
void AnalyzerContainer::ChangeAnalyzer(int id) {
void AnalyzerContainer::ChangeAnalyzer(const int id) {
QObject *instance = analyzer_types_[id]->newInstance(Q_ARG(QWidget*, this));
@@ -201,7 +201,7 @@ void AnalyzerContainer::Load() {
}
void AnalyzerContainer::SaveFramerate(int framerate) {
void AnalyzerContainer::SaveFramerate(const int framerate) {
// For now, framerate is common for all analyzers. Maybe each analyzer should have its own framerate?
current_framerate_ = framerate;
@@ -221,12 +221,12 @@ void AnalyzerContainer::Save() {
}
void AnalyzerContainer::AddFramerate(const QString& name, int framerate) {
void AnalyzerContainer::AddFramerate(const QString& name, const int framerate) {
QAction *action = context_menu_framerate_->addAction(name);
group_framerate_->addAction(action);
framerate_list_ << framerate;
action->setCheckable(true);
connect(action, &QAction::triggered, [this, framerate]() { ChangeFramerate(framerate); } );
QObject::connect(action, &QAction::triggered, [this, framerate]() { ChangeFramerate(framerate); } );
}

View File

@@ -60,7 +60,7 @@ class AnalyzerContainer : public QWidget {
void wheelEvent(QWheelEvent *e) override;
private slots:
void ChangeAnalyzer(int id);
void ChangeAnalyzer(const int id);
void ChangeFramerate(int new_framerate);
void DisableAnalyzer();
void ShowPopupMenu();
@@ -73,10 +73,10 @@ class AnalyzerContainer : public QWidget {
void Load();
void Save();
void SaveFramerate(int framerate);
void SaveFramerate(const int framerate);
template <typename T>
void AddAnalyzerType();
void AddFramerate(const QString& name, int framerate);
void AddFramerate(const QString& name, const int framerate);
private:
int current_framerate_; // fps
@@ -109,7 +109,7 @@ void AnalyzerContainer::AddAnalyzerType() {
group_->addAction(action);
action->setCheckable(true);
actions_ << action;
connect(action, &QAction::triggered, [this, id]() { ChangeAnalyzer(id); } );
QObject::connect(action, &QAction::triggered, [this, id]() { ChangeAnalyzer(id); } );
}

View File

@@ -44,15 +44,15 @@ class BoomAnalyzer : public Analyzer::Base {
static const char* kName;
void transform(Analyzer::Scope& s) override;
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame) override;
void transform(Analyzer::Scope &s) override;
void analyze(QPainter &p, const Analyzer::Scope&, bool new_frame) override;
public slots:
void changeK_barHeight(int);
void changeF_peakSpeed(int);
protected:
void resizeEvent(QResizeEvent* e) override;
void resizeEvent(QResizeEvent *e) override;
static const uint kColumnWidth;
static const uint kMaxBandCount;

View File

@@ -50,14 +50,14 @@ class RainbowAnalyzer : public Analyzer::Base {
Dash = 1
};
RainbowAnalyzer(const RainbowType& rbtype, QWidget* parent);
RainbowAnalyzer(const RainbowType &rbtype, QWidget *parent);
protected:
void transform(Analyzer::Scope&) override;
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame) override;
void analyze(QPainter &p, const Analyzer::Scope&, bool new_frame) override;
void timerEvent(QTimerEvent* e) override;
void resizeEvent(QResizeEvent* e) override;
void timerEvent(QTimerEvent *e) override;
void resizeEvent(QResizeEvent *e) override;
private:
static const int kHeight[];