diff --git a/src/App/PropertyGeo.cpp b/src/App/PropertyGeo.cpp index 6ce4186d76..637b96ce51 100644 --- a/src/App/PropertyGeo.cpp +++ b/src/App/PropertyGeo.cpp @@ -589,7 +589,7 @@ double toDouble(const boost::any &value) void PropertyPlacement::setPathValue(const ObjectIdentifier &path, const boost::any &value) { - auto updateAxis = [=](int index, double coord) { + auto updateAxis = [this](int index, double coord) { Base::Vector3d axis; double angle; Base::Vector3d base = _cPos.getPosition(); @@ -601,7 +601,7 @@ void PropertyPlacement::setPathValue(const ObjectIdentifier &path, const boost:: setValue(plm); }; - auto updateYawPitchRoll = [=](int index, double angle) { + auto updateYawPitchRoll = [this](int index, double angle) { Base::Vector3d base = _cPos.getPosition(); Base::Rotation rot = _cPos.getRotation(); double yaw, pitch, roll; @@ -1076,7 +1076,7 @@ void PropertyRotation::getPaths(std::vector &paths) const void PropertyRotation::setPathValue(const ObjectIdentifier &path, const boost::any &value) { - auto updateAxis = [=](int index, double coord) { + auto updateAxis = [this](int index, double coord) { Base::Vector3d axis; double angle; _rot.getRawValue(axis, angle); diff --git a/src/Gui/DlgKeyboardImp.cpp b/src/Gui/DlgKeyboardImp.cpp index 08f0381c34..f8adcba5b9 100644 --- a/src/Gui/DlgKeyboardImp.cpp +++ b/src/Gui/DlgKeyboardImp.cpp @@ -105,7 +105,7 @@ DlgCustomKeyboardImp::DlgCustomKeyboardImp( QWidget* parent ) QObject::connect(ui->shortcutTimeout, qOverload(&QSpinBox::valueChanged), timer, [=](int) { timer->start(100); }); - QObject::connect(timer, &QTimer::timeout, [=]() { + QObject::connect(timer, &QTimer::timeout, [this]() { ui->shortcutTimeout->onSave(); }); } diff --git a/src/Gui/DlgSettingsColorGradientImp.cpp b/src/Gui/DlgSettingsColorGradientImp.cpp index d062cac461..b6d817ac0d 100644 --- a/src/Gui/DlgSettingsColorGradientImp.cpp +++ b/src/Gui/DlgSettingsColorGradientImp.cpp @@ -195,7 +195,7 @@ bool DlgSettingsColorGradientImp::isOutInvisible() const void DlgSettingsColorGradientImp::setRange(float fMin, float fMax) { - auto toString = [=](float value, int decimals) { + auto toString = [this](float value, int decimals) { int pos = 0; while (decimals > 0) { QString str = QLocale().toString(value, 'g', decimals--); diff --git a/src/Gui/PreferencePages/DlgSettingsUI.cpp b/src/Gui/PreferencePages/DlgSettingsUI.cpp index f9252436e2..c73ac98022 100644 --- a/src/Gui/PreferencePages/DlgSettingsUI.cpp +++ b/src/Gui/PreferencePages/DlgSettingsUI.cpp @@ -654,7 +654,7 @@ void DlgSettingsUI::init() QObject::connect(DockOverlayAnimationCurve, QOverload::of(&QComboBox::currentIndexChanged), this, &DlgSettingsUI::onCurveChange); - QObject::connect(timer, &QTimer::timeout, [=]() { + QObject::connect(timer, &QTimer::timeout, [this]() { if (animator1->state() != QAbstractAnimation::Running) { this->setOffset1(1); this->a1 = this->b1 = 0; diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index 3d9dec3a29..c9f50a0e0c 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -546,7 +546,7 @@ void QuantitySpinBox::openFormulaDialog() if (d->checkRangeInExpression) { box->setRange(d->minimum, d->maximum); } - QObject::connect(box, &Gui::Dialog::DlgExpressionInput::finished, [=]() { + QObject::connect(box, &Gui::Dialog::DlgExpressionInput::finished, [this, box]() { if (box->result() == QDialog::Accepted) setExpression(box->getExpression()); else if (box->discardedFormula()) diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index 85113b3df2..fd92a3f3a3 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -52,7 +52,7 @@ ExpressionSpinBox::ExpressionSpinBox(QAbstractSpinBox* sb) { lineedit = spinbox->findChild(); makeLabel(lineedit); - QObject::connect(iconLabel, &ExpressionLabel::clicked, [=]() { + QObject::connect(iconLabel, &ExpressionLabel::clicked, [this]() { this->openFormulaDialog(); }); } @@ -183,7 +183,7 @@ void ExpressionSpinBox::openFormulaDialog() unit = qprop->getUnit(); auto box = new Gui::Dialog::DlgExpressionInput(getPath(), getExpression(), unit, spinbox); - QObject::connect(box, &Gui::Dialog::DlgExpressionInput::finished, [=]() { + QObject::connect(box, &Gui::Dialog::DlgExpressionInput::finished, [this, box]() { if (box->result() == QDialog::Accepted) setExpression(box->getExpression()); else if (box->discardedFormula()) diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index c6fba06b3e..0f74fbd49e 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -5050,7 +5050,7 @@ void DocumentObjectItem::restoreBackground() { void DocumentObjectItem::setHighlight(bool set, Gui::HighlightMode high) { QFont f = this->font(0); - auto highlight = [=](const QColor& col) { + auto highlight = [this, set](const QColor& col) { if (set) this->setBackground(0, col); else diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index c12b70bbd5..0692f97765 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -1714,7 +1714,7 @@ ButtonGroup::ButtonGroup(QObject *parent) QButtonGroup::setExclusive(false); connect(this, qOverload(&QButtonGroup::buttonClicked), - [=](QAbstractButton *button) { + [this](QAbstractButton *button) { if (exclusive()) { const auto btns = buttons(); for (auto btn : btns) { diff --git a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp index deedc32b87..7dba042486 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintBearing.cpp @@ -108,10 +108,10 @@ TaskFemConstraintBearing::TaskFemConstraintBearing(ViewProviderFemConstraint* Co qOverload(&QDoubleSpinBox::valueChanged), this, &TaskFemConstraintBearing::onDistanceChanged); - connect(ui->buttonReference, &QPushButton::pressed, this, [=] { + connect(ui->buttonReference, &QPushButton::pressed, this, [this] { onButtonReference(true); }); - connect(ui->buttonLocation, &QPushButton::pressed, this, [=] { + connect(ui->buttonLocation, &QPushButton::pressed, this, [this] { onButtonLocation(true); }); connect(ui->checkAxial, &QCheckBox::toggled, this, &TaskFemConstraintBearing::onCheckAxial); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 58fc8bc491..3410a64839 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -179,7 +179,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary( this, &TaskFemConstraintFluidBoundary::onThermalBoundaryTypeChanged); - connect(ui->buttonDirection, &QPushButton::pressed, this, [=] { + connect(ui->buttonDirection, &QPushButton::pressed, this, [this] { onButtonDirection(true); }); connect(ui->checkReverse, diff --git a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp index f815e5d994..e74b863127 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintGear.cpp @@ -62,7 +62,7 @@ TaskFemConstraintGear::TaskFemConstraintGear(ViewProviderFemConstraint* Constrai qOverload(&QDoubleSpinBox::valueChanged), this, &TaskFemConstraintGear::onForceAngleChanged); - connect(ui->buttonDirection, &QPushButton::pressed, this, [=] { + connect(ui->buttonDirection, &QPushButton::pressed, this, [this] { onButtonDirection(true); }); connect(ui->checkReversed, &QCheckBox::toggled, this, &TaskFemConstraintGear::onCheckReversed); diff --git a/src/Mod/Import/App/dxf/ImpExpDxf.cpp b/src/Mod/Import/App/dxf/ImpExpDxf.cpp index dbe6882acc..d1f12f99f9 100644 --- a/src/Mod/Import/App/dxf/ImpExpDxf.cpp +++ b/src/Mod/Import/App/dxf/ImpExpDxf.cpp @@ -420,7 +420,7 @@ void ImpExpDxfRead::OnReadText(const Base::Vector3d& point, // Note that our parameters do not contain all the information needed to properly orient the // text. As a result the text will always appear on the XY plane if (m_importAnnotations) { - auto makeText = [=](const Base::Matrix4D& transform) -> App::FeaturePython* { + auto makeText = [this, rotation, point, text, height](const Base::Matrix4D& transform) -> App::FeaturePython* { PyObject* draftModule = getDraftModule(); if (draftModule != nullptr) { Base::Matrix4D localTransform; @@ -537,7 +537,7 @@ void ImpExpDxfRead::OnReadDimension(const Base::Vector3d& start, double /*rotation*/) { if (m_importAnnotations) { - auto makeDimension = [=](const Base::Matrix4D& transform) -> App::FeaturePython* { + auto makeDimension = [this, start, end, point](const Base::Matrix4D& transform) -> App::FeaturePython* { PyObject* draftModule = getDraftModule(); if (draftModule != nullptr) { // TODO: Capture and apply OCSOrientationTransform to OCS coordinates diff --git a/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp b/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp index 24fd6ebfe2..eb969ce942 100644 --- a/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp +++ b/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp @@ -229,7 +229,7 @@ void TaskShapeBinder::removeFromListWidget(QListWidget* widget, QString itemstr) void TaskShapeBinder::onSelectionChanged(const Gui::SelectionChanges& msg) { - auto setObjectLabel = [=](const Gui::SelectionChanges& msg) { + auto setObjectLabel = [this](const Gui::SelectionChanges& msg) { App::DocumentObject* obj = msg.Object.getObject(); if (obj) { ui->baseEdit->setText(QString::fromStdString(obj->Label.getStrValue())); diff --git a/src/Mod/Sketcher/Gui/DrawSketchController.h b/src/Mod/Sketcher/Gui/DrawSketchController.h index 03906081a8..2ee429f65c 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchController.h +++ b/src/Mod/Sketcher/Gui/DrawSketchController.h @@ -587,7 +587,7 @@ protected: /*avoidMouseCursor = */ true)) .get(); - QObject::connect(parameter, &Gui::EditableDatumLabel::valueChanged, [=](double value) { + QObject::connect(parameter, &Gui::EditableDatumLabel::valueChanged, [this, parameter, i](double value) { parameter->setColor(colorManager.dimConstrColor); onViewValueChanged(i, value); }); diff --git a/src/Mod/TechDraw/Gui/TaskProjGroup.cpp b/src/Mod/TechDraw/Gui/TaskProjGroup.cpp index d2cc2638bb..043810c0f7 100644 --- a/src/Mod/TechDraw/Gui/TaskProjGroup.cpp +++ b/src/Mod/TechDraw/Gui/TaskProjGroup.cpp @@ -108,7 +108,7 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawProjGroup* featView, bool mode) : #if QT_VERSION < QT_VERSION_CHECK(5,15,0) connect(ui->projection, qOverload(&QComboBox::currentIndexChanged), this, &TaskProjGroup::projectionTypeChanged); #else - connect(ui->projection, qOverload(&QComboBox::currentIndexChanged), this, [=](int index) { + connect(ui->projection, qOverload(&QComboBox::currentIndexChanged), this, [this](int index) { projectionTypeChanged(ui->projection->itemText(index)); }); #endif diff --git a/src/Mod/TechDraw/Gui/mrichtextedit.cpp b/src/Mod/TechDraw/Gui/mrichtextedit.cpp index 813ae665fc..97f18639db 100644 --- a/src/Mod/TechDraw/Gui/mrichtextedit.cpp +++ b/src/Mod/TechDraw/Gui/mrichtextedit.cpp @@ -210,7 +210,7 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent) connect(f_fontsize, qOverload(&QComboBox::currentIndexChanged), this, &MRichTextEdit::textSize); #else - connect(f_fontsize, qOverload(&QComboBox::currentIndexChanged), this, [=](int index) { + connect(f_fontsize, qOverload(&QComboBox::currentIndexChanged), this, [this](int index) { textSize(f_fontsize->itemText(index)); }); #endif