diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index 2b0ca4fec..8b2c0f35e 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -341,7 +341,6 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) m_waterfall = new SaWaterfallView(controls, processor, this); display_splitter->addWidget(m_waterfall); m_waterfall->setVisible(m_controls->m_waterfallModel.value()); - connect(&controls->m_waterfallModel, &BoolModel::dataChanged, [=] {m_waterfall->updateVisibility();}); } diff --git a/plugins/SpectrumAnalyzer/SaWaterfallView.cpp b/plugins/SpectrumAnalyzer/SaWaterfallView.cpp index 5169a4b49..b3e57d7c0 100644 --- a/plugins/SpectrumAnalyzer/SaWaterfallView.cpp +++ b/plugins/SpectrumAnalyzer/SaWaterfallView.cpp @@ -54,6 +54,7 @@ SaWaterfallView::SaWaterfallView(SaControls *controls, SaProcessor *processor, Q setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); connect(getGUI()->mainWindow(), SIGNAL(periodicUpdate()), this, SLOT(periodicUpdate())); + connect(&controls->m_waterfallModel, &BoolModel::dataChanged, this, &SaWaterfallView::updateVisibility); m_displayTop = 1; m_displayBottom = height() -2; diff --git a/plugins/Vibed/NineButtonSelector.cpp b/plugins/Vibed/NineButtonSelector.cpp index 3a68e5ee6..38c890d80 100644 --- a/plugins/Vibed/NineButtonSelector.cpp +++ b/plugins/Vibed/NineButtonSelector.cpp @@ -47,7 +47,7 @@ NineButtonSelector::NineButtonSelector(std::array onOffIcons, int d m_buttons[i]->setActiveGraphic(onOffIcons[i * 2]); m_buttons[i]->setInactiveGraphic(onOffIcons[(i * 2) + 1]); m_buttons[i]->setChecked(false); - connect(m_buttons[i].get(), &PixmapButton::clicked, this, [=](){ this->buttonClicked(i); }); + connect(m_buttons[i].get(), &PixmapButton::clicked, this, [=, this](){ buttonClicked(i); }); } m_lastBtn = m_buttons[defaultButton].get(); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index e5168fac8..a9f18d6fd 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -635,7 +635,7 @@ void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent * e ) contextMenu.addAction( tr( "Send to active instrument-track" ), - [=]{ sendToActiveInstrumentTrack(file); } + [=, this]{ sendToActiveInstrumentTrack(file); } ); contextMenu.addSeparator(); @@ -643,7 +643,7 @@ void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent * e ) contextMenu.addAction( QIcon(embed::getIconPixmap("folder")), tr("Open containing folder"), - [=]{ openContainingFolder(file); } + [=, this]{ openContainingFolder(file); } ); auto songEditorHeader = new QAction(tr("Song Editor"), nullptr); @@ -676,14 +676,14 @@ QList FileBrowserTreeWidget::getContextActions(FileItem* file, bool so auto toInstrument = new QAction(instrumentAction + tr(" (%2Enter)").arg(shortcutMod), nullptr); connect(toInstrument, &QAction::triggered, - [=]{ openInNewInstrumentTrack(file, songEditor); }); + [=, this]{ openInNewInstrumentTrack(file, songEditor); }); result.append(toInstrument); if (songEditor && fileIsSample) { auto toSampleTrack = new QAction(tr("Send to new sample track (Shift + Enter)"), nullptr); connect(toSampleTrack, &QAction::triggered, - [=]{ openInNewSampleTrack(file); }); + [=, this]{ openInNewSampleTrack(file); }); result.append(toSampleTrack); } diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index 20660df41..3b952ba0a 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -94,7 +94,7 @@ MicrotunerConfig::MicrotunerConfig() : auto scaleCombo = new ComboBox(); scaleCombo->setModel(&m_scaleComboModel); microtunerLayout->addWidget(scaleCombo, 1, 0, 1, 2); - connect(&m_scaleComboModel, &ComboBoxModel::dataChanged, [=] {updateScaleForm();}); + connect(&m_scaleComboModel, &ComboBoxModel::dataChanged, this, &MicrotunerConfig::updateScaleForm); m_scaleNameEdit = new QLineEdit("12-TET"); m_scaleNameEdit->setToolTip(tr("Scale description. Cannot start with \"!\" and cannot contain a newline character.")); @@ -106,8 +106,8 @@ MicrotunerConfig::MicrotunerConfig() : saveScaleButton->setToolTip(tr("Save scale definition to a file.")); microtunerLayout->addWidget(loadScaleButton, 3, 0, 1, 1); microtunerLayout->addWidget(saveScaleButton, 3, 1, 1, 1); - connect(loadScaleButton, &QPushButton::clicked, [=] {loadScaleFromFile();}); - connect(saveScaleButton, &QPushButton::clicked, [=] {saveScaleToFile();}); + connect(loadScaleButton, &QPushButton::clicked, this, &MicrotunerConfig::loadScaleFromFile); + connect(saveScaleButton, &QPushButton::clicked, this, &MicrotunerConfig::saveScaleToFile); m_scaleTextEdit = new QPlainTextEdit(); m_scaleTextEdit->setPlainText("100.0\n200.0\n300.0\n400.0\n500.0\n600.0\n700.0\n800.0\n900.0\n1000.0\n1100.0\n1200.0"); @@ -117,7 +117,7 @@ MicrotunerConfig::MicrotunerConfig() : auto applyScaleButton = new QPushButton(tr("Apply scale changes")); applyScaleButton->setToolTip(tr("Verify and apply changes made to the selected scale. To use the scale, select it in the settings of a supported instrument.")); microtunerLayout->addWidget(applyScaleButton, 6, 0, 1, 2); - connect(applyScaleButton, &QPushButton::clicked, [=] {applyScale();}); + connect(applyScaleButton, &QPushButton::clicked, this, &MicrotunerConfig::applyScale); // ---------------------------------- // Mapping sub-column @@ -132,7 +132,7 @@ MicrotunerConfig::MicrotunerConfig() : auto keymapCombo = new ComboBox(); keymapCombo->setModel(&m_keymapComboModel); microtunerLayout->addWidget(keymapCombo, 1, 2, 1, 2); - connect(&m_keymapComboModel, &ComboBoxModel::dataChanged, [=] {updateKeymapForm();}); + connect(&m_keymapComboModel, &ComboBoxModel::dataChanged, this, &MicrotunerConfig::updateKeymapForm); m_keymapNameEdit = new QLineEdit("default"); m_keymapNameEdit->setToolTip(tr("Keymap description. Cannot start with \"!\" and cannot contain a newline character.")); @@ -144,8 +144,8 @@ MicrotunerConfig::MicrotunerConfig() : saveKeymapButton->setToolTip(tr("Save key mapping definition to a file.")); microtunerLayout->addWidget(loadKeymapButton, 3, 2, 1, 1); microtunerLayout->addWidget(saveKeymapButton, 3, 3, 1, 1); - connect(loadKeymapButton, &QPushButton::clicked, [=] {loadKeymapFromFile();}); - connect(saveKeymapButton, &QPushButton::clicked, [=] {saveKeymapToFile();}); + connect(loadKeymapButton, &QPushButton::clicked, this, &MicrotunerConfig::loadKeymapFromFile); + connect(saveKeymapButton, &QPushButton::clicked, this, &MicrotunerConfig::saveKeymapToFile); m_keymapTextEdit = new QPlainTextEdit(); m_keymapTextEdit->setPlainText("0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11"); @@ -189,7 +189,7 @@ MicrotunerConfig::MicrotunerConfig() : auto applyKeymapButton = new QPushButton(tr("Apply keymap changes")); applyKeymapButton->setToolTip(tr("Verify and apply changes made to the selected key mapping. To use the mapping, select it in the settings of a supported instrument.")); microtunerLayout->addWidget(applyKeymapButton, 6, 2, 1, 2); - connect(applyKeymapButton, &QPushButton::clicked, [=] {applyKeymap();}); + connect(applyKeymapButton, &QPushButton::clicked, this, &MicrotunerConfig::applyKeymap); updateScaleForm(); updateKeymapForm(); @@ -325,7 +325,7 @@ void MicrotunerConfig::updateKeymapForm() */ bool MicrotunerConfig::validateScaleForm() { - auto fail = [=](QString message) {QMessageBox::critical(this, tr("Scale parsing error"), message);}; + auto fail = [this](const QString& message){ QMessageBox::critical(this, tr("Scale parsing error"), message); }; // check name QString name = m_scaleNameEdit->text(); @@ -373,7 +373,7 @@ bool MicrotunerConfig::validateScaleForm() */ bool MicrotunerConfig::validateKeymapForm() { - auto fail = [=](QString message) {QMessageBox::critical(this, tr("Keymap parsing error"), message);}; + auto fail = [this](const QString& message){ QMessageBox::critical(this, tr("Keymap parsing error"), message); }; // check name QString name = m_keymapNameEdit->text(); diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index 2594bdab3..4bf62d4ea 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -297,7 +297,7 @@ void PluginDescWidget::contextMenuEvent(QContextMenuEvent* e) QMenu contextMenu(this); contextMenu.addAction( tr("Send to new instrument track"), - [=]{ openInNewInstrumentTrack(m_pluginKey.desc->name); } + [=, this]{ openInNewInstrumentTrack(m_pluginKey.desc->name); } ); contextMenu.exec(e->globalPos()); } diff --git a/src/gui/SideBarWidget.cpp b/src/gui/SideBarWidget.cpp index 5a73cb471..5439b2791 100644 --- a/src/gui/SideBarWidget.cpp +++ b/src/gui/SideBarWidget.cpp @@ -50,7 +50,7 @@ SideBarWidget::SideBarWidget( const QString & _title, const QPixmap & _icon, m_closeBtn->resize(m_buttonSize); m_closeBtn->setToolTip(tr("Close")); connect(m_closeBtn, &QPushButton::clicked, - [=]() { this->closeButtonClicked(); }); + [this]() { this->closeButtonClicked(); }); } diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 2193456e4..60403e41a 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -3098,7 +3098,7 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) // allow quantization grid up to 1/32 for normal notes else if (q < 6) { q = 6; } } - auto xCoordOfTick = [=](int tick) { + auto xCoordOfTick = [this](int tick) { return m_whiteKeyWidth + ( (tick - m_currentPosition) * m_ppb / TimePos::ticksPerBar() );