fix: c++20 deprecate [=]

This commit is contained in:
ppphp
2024-03-30 13:52:02 +08:00
committed by wwmayer
parent 6fbd8916ab
commit da7ee06d67
16 changed files with 21 additions and 21 deletions

View File

@@ -108,10 +108,10 @@ TaskFemConstraintBearing::TaskFemConstraintBearing(ViewProviderFemConstraint* Co
qOverload<double>(&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);

View File

@@ -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,

View File

@@ -62,7 +62,7 @@ TaskFemConstraintGear::TaskFemConstraintGear(ViewProviderFemConstraint* Constrai
qOverload<double>(&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);

View File

@@ -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

View File

@@ -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()));

View File

@@ -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);
});

View File

@@ -108,7 +108,7 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawProjGroup* featView, bool mode) :
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
connect(ui->projection, qOverload<const QString&>(&QComboBox::currentIndexChanged), this, &TaskProjGroup::projectionTypeChanged);
#else
connect(ui->projection, qOverload<int>(&QComboBox::currentIndexChanged), this, [=](int index) {
connect(ui->projection, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
projectionTypeChanged(ui->projection->itemText(index));
});
#endif

View File

@@ -210,7 +210,7 @@ MRichTextEdit::MRichTextEdit(QWidget *parent, QString textIn) : QWidget(parent)
connect(f_fontsize, qOverload<const QString&>(&QComboBox::currentIndexChanged),
this, &MRichTextEdit::textSize);
#else
connect(f_fontsize, qOverload<int>(&QComboBox::currentIndexChanged), this, [=](int index) {
connect(f_fontsize, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
textSize(f_fontsize->itemText(index));
});
#endif