Skip to content

Commit

Permalink
Fix C++20 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronwhite committed Dec 17, 2023
1 parent 52253d1 commit 5f3b5d1
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 89 deletions.
4 changes: 2 additions & 2 deletions source/actions/undomanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void UndoManager::push(QUndoCommand *cmd, int affectedSystem)
auto onUndo = new SignalOnUndo();
if (affectedSystem >= 0)
{
connect(onUndo, &SignalOnUndo::triggered, [=]() {
connect(onUndo, &SignalOnUndo::triggered, [=, this]() {
onSystemChanged(affectedSystem);
});
}
Expand All @@ -70,7 +70,7 @@ void UndoManager::push(QUndoCommand *cmd, int affectedSystem)
auto onRedo = new SignalOnRedo();
if (affectedSystem >= 0)
{
connect(onRedo, &SignalOnRedo::triggered, [=]() {
connect(onRedo, &SignalOnRedo::triggered, [=, this]() {
onSystemChanged(affectedSystem);
});
}
Expand Down
132 changes: 66 additions & 66 deletions source/app/powertabeditor.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion source/app/recentfiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void RecentFiles::updateMenu()
auto fileAction = new QAction(fileName, myRecentFilesMenu);
myRecentFilesMenu->addAction(fileAction);

connect(fileAction, &QAction::triggered, [=]() {
connect(fileAction, &QAction::triggered, [=, this]() {
handleFileSelection(fileName);
});
}
Expand Down
2 changes: 1 addition & 1 deletion source/app/scorearea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void ScoreArea::renderDocument(const Document &document)

myCaretPainter = new CaretPainter(
document.getCaret(), document.getViewOptions(), *myActivePalette);
myCaretPainter->subscribeToMovement([=]() {
myCaretPainter->subscribeToMovement([this]() {
adjustScroll();
});

Expand Down
6 changes: 3 additions & 3 deletions source/dialogs/bulkconverterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ BulkConverterDialog::BulkConverterDialog(QWidget *parent,
auto flags = windowFlags();
setWindowFlags(flags | Qt::WindowStaysOnTopHint);

connect(ui->fileLocatorSource, &QAbstractButton::clicked, [=]() {
connect(ui->fileLocatorSource, &QAbstractButton::clicked, [this]() {
setPath(ui->sourcePathEdit);
});

connect(ui->fileLocatorDestination, &QAbstractButton::clicked, [=]() {
connect(ui->fileLocatorDestination, &QAbstractButton::clicked, [this]() {
setPath(ui->destinationPathEdit);
});

Expand All @@ -170,7 +170,7 @@ BulkConverterDialog::BulkConverterDialog(QWidget *parent,

convertButton()->setEnabled(false);
convertButton()->setText(tr("Convert"));
connect(convertButton(), &QAbstractButton::clicked, [=](){ convert(); });
connect(convertButton(), &QAbstractButton::clicked, [this](){ convert(); });
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}

Expand Down
2 changes: 1 addition & 1 deletion source/dialogs/infodialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ InfoDialog::InfoDialog(QWidget *parent) :

setInfo();

connect(ui->copyToClipboardButton, &QAbstractButton::clicked, [=]() {
connect(ui->copyToClipboardButton, &QAbstractButton::clicked, [this]() {
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(ui->appInfo->toPlainText());
});
Expand Down
4 changes: 2 additions & 2 deletions source/dialogs/keysignaturedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ KeySignatureDialog::KeySignatureDialog(QWidget *parent,
else
ui->minorKeyButton->setChecked(true);

connect(ui->majorKeyButton, &QAbstractButton::clicked, [=]() {
connect(ui->majorKeyButton, &QAbstractButton::clicked, [this]() {
populateKeyTypes(KeySignature::Major);
});
connect(ui->minorKeyButton, &QAbstractButton::clicked, [=]() {
connect(ui->minorKeyButton, &QAbstractButton::clicked, [this]() {
populateKeyTypes(KeySignature::Minor);
});

Expand Down
4 changes: 2 additions & 2 deletions source/dialogs/viewfilterdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ void ViewFilterDialog::update(const std::vector<std::string> &names,
ui->filterRuleLayout->addWidget(widget);

connect(widget, &FilterRuleWidget::changed,
[=](const FilterRule &rule) {
[=, this](const FilterRule &rule) {
myPresenter->editRule(i, rule);
});
connect(widget, &FilterRuleWidget::removeRequested, [=]() {
connect(widget, &FilterRuleWidget::removeRequested, [=, this]() {
myPresenter->removeRule(i);
});
}
Expand Down
2 changes: 1 addition & 1 deletion source/painters/caretpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CaretPainter::CaretPainter(const Caret &caret, const ViewOptions &view_options,
myViewOptions(view_options),
myPalette(palette),
myCaretConnection(
caret.subscribeToChanges([=]() { onLocationChanged(); }))
caret.subscribeToChanges([this]() { onLocationChanged(); }))
{
}

Expand Down
2 changes: 1 addition & 1 deletion source/widgets/clickablelabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ClickableLabel::ClickableLabel(QWidget *parent)

void ClickableLabel::enterEvent(QEvent *)
{
setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
setFrameStyle(static_cast<int>(QFrame::StyledPanel) | static_cast<int>(QFrame::Raised));
setCursor(Qt::PointingHandCursor);
}

Expand Down
4 changes: 2 additions & 2 deletions source/widgets/instruments/instrumentpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ void InstrumentPanel::reset(const Score &score)
{
auto item = new InstrumentPanelItem(this, i, score.getInstruments()[i]);
connect(item, &InstrumentPanelItem::instrumentEdited,
[=](const Instrument &inst) { instrumentEdited(i, inst); });
[=, this](const Instrument &inst) { instrumentEdited(i, inst); });
connect(item, &InstrumentPanelItem::instrumentRemoved,
[=]() { instrumentRemoved(i); });
[=, this]() { instrumentRemoved(i); });

myLayout->addWidget(item);
}
Expand Down
2 changes: 1 addition & 1 deletion source/widgets/instruments/instrumentpanelitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ InstrumentPanelItem::InstrumentPanelItem(QWidget *parent, int instrumentIndex,
ui->instrumentNameLabel, &QWidget::hide);
connect(ui->instrumentNameLabel, &ClickableLabel::clicked,
ui->instrumentNameEdit, &QWidget::show);
connect(ui->instrumentNameLabel, &ClickableLabel::clicked, [=]()
connect(ui->instrumentNameLabel, &ClickableLabel::clicked, [this]()
{ ui->instrumentNameEdit->setFocus(); });

connect(ui->instrumentNameEdit, &QLineEdit::editingFinished, this,
Expand Down
4 changes: 2 additions & 2 deletions source/widgets/mixer/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ void Mixer::reset(const Score &score)
{
auto item = new MixerItem(this, i, score.getPlayers()[i], myDictionary);
connect(item, &MixerItem::playerEdited,
[=](const Player &player, bool undoable) {
[=, this](const Player &player, bool undoable) {
playerEdited(i, player, undoable);
});
connect(item, &MixerItem::playerRemoved, [=]() { playerRemoved(i); });
connect(item, &MixerItem::playerRemoved, [=, this]() { playerRemoved(i); });
myLayout->addWidget(item);
}
}
Expand Down
6 changes: 3 additions & 3 deletions source/widgets/mixer/mixeritem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ MixerItem::MixerItem(QWidget *parent, int playerIndex, const Player &player,
&QWidget::hide);
connect(ui->playerNameLabel, &ClickableLabel::clicked, ui->playerNameEdit,
&QWidget::show);
connect(ui->playerNameLabel, &ClickableLabel::clicked, [=]() {
connect(ui->playerNameLabel, &ClickableLabel::clicked, [this]() {
ui->playerNameEdit->setFocus();
});

connect(ui->playerNameEdit, &QLineEdit::editingFinished, this,
&MixerItem::onPlayerNameEdited);

connect(ui->playerVolume, &QSlider::valueChanged, [=]() {
connect(ui->playerVolume, &QSlider::valueChanged, [this]() {
onEdited(false);
});
connect(ui->playerPan, &QDial::valueChanged, [=]() {
connect(ui->playerPan, &QDial::valueChanged, [this]() {
onEdited(false);
});

Expand Down
2 changes: 1 addition & 1 deletion source/widgets/playback/playbackwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ PlaybackWidget::setupZoomComboBox(double initial_zoom)
ui->zoomComboBox->setValidator(new PercentageValidator(ui->zoomComboBox));

connect(ui->zoomComboBox, &QComboBox::currentTextChanged,
[=](const QString &text) {
[this](const QString &text) {
// Trigger an update for the stylesheet.
ui->zoomComboBox->style()->unpolish(ui->zoomComboBox);
ui->zoomComboBox->style()->polish(ui->zoomComboBox);
Expand Down

0 comments on commit 5f3b5d1

Please sign in to comment.