diff --git a/GUI/Model/Descriptor/SelectionProperty.h b/GUI/Model/Descriptor/SelectionProperty.h index 6abd84f2f73f8aafcf4cbfd9e540572618cb2b71..8fd285fc90d586c18aa6d178dabe86fc1ec61317 100644 --- a/GUI/Model/Descriptor/SelectionProperty.h +++ b/GUI/Model/Descriptor/SelectionProperty.h @@ -185,7 +185,7 @@ private: for (const auto type : m_types) m_options << Catalog::uiInfo(type).menuEntry; - currentIndexSetter = [=](int current) { + currentIndexSetter = [&](int current) { auto* p = Catalog::create(m_types[current], argsForCreation...); if (m_initializer) m_initializer(p, m_p.get()); diff --git a/GUI/Model/FromCore/ItemizeSample.cpp b/GUI/Model/FromCore/ItemizeSample.cpp index 7ced78c4d425fea1ad7f6d30bf97dda2693a7cae..6bce1e2ad2511292aebccd58baa0960ddfd399a3 100644 --- a/GUI/Model/FromCore/ItemizeSample.cpp +++ b/GUI/Model/FromCore/ItemizeSample.cpp @@ -603,7 +603,7 @@ void copyParticle(const IParticle* iparticle, MaterialModel& matItems, addToParent(item); copyParticle(meso->particleStructure().basis(), matItems, - [=](ItemWithParticles* p) { item->setBasisItem(p); }); + [&](ItemWithParticles* p) { item->setBasisItem(p); }); } else if (const auto* particleComposition = dynamic_cast<const Compound*>(iparticle)) { auto* item = new CompoundItem(&matItems); @@ -615,7 +615,7 @@ void copyParticle(const IParticle* iparticle, MaterialModel& matItems, for (const auto* p : particleComposition->particles()) copyParticle(p, matItems, - [=](ItemWithParticles* p) { item->addItemWithParticleSelection(p); }); + [&](ItemWithParticles* p) { item->addItemWithParticleSelection(p); }); } } @@ -654,7 +654,7 @@ SampleItem* itemizeSample(const MultiLayer& sample, const QString& nodeName) // create particles/particle compositions for (const IParticle* particle : layout->particles()) - copyParticle(particle, matItems, [=](ItemWithParticles* p) { + copyParticle(particle, matItems, [&](ItemWithParticles* p) { layoutItem->addItemWithParticleSelection(p); }); } diff --git a/GUI/Model/Model/FitParameterModel.cpp b/GUI/Model/Model/FitParameterModel.cpp index 69953dd04a0b875c4d212290ba885939f728ad68..4aa7197519e339a660eb652732eb8b05a2d66177 100644 --- a/GUI/Model/Model/FitParameterModel.cpp +++ b/GUI/Model/Model/FitParameterModel.cpp @@ -33,8 +33,8 @@ FitParameterModel::FitParameterModel(FitParameterContainerItem* fitParContainer, connectContainer(); connect(fitParContainer, &QObject::destroyed, this, - [=]() { m_fitParameterContainer = nullptr; }); - connect(jobItem, &QObject::destroyed, this, [=]() { m_jobItem = nullptr; }); + [&]() { m_fitParameterContainer = nullptr; }); + connect(jobItem, &QObject::destroyed, this, [&]() { m_jobItem = nullptr; }); } Qt::ItemFlags FitParameterModel::flags(const QModelIndex& index) const diff --git a/GUI/Model/Model/ParameterTreeUtil.cpp b/GUI/Model/Model/ParameterTreeUtil.cpp index a4de5618981ecf0a7dd5019fd5713484ce13478d..4e3d753fc899ad9d09edd0b501fa4225edf5db1a 100644 --- a/GUI/Model/Model/ParameterTreeUtil.cpp +++ b/GUI/Model/Model/ParameterTreeUtil.cpp @@ -361,7 +361,7 @@ void ParameterTreeBuilder::addBeamDistribution(ParameterLabelItem* parentLabel, void ParameterTreeBuilder::addDetector(ParameterLabelItem* parentLabel, DetectorItem* detector) { - const auto addResolutionFunction = [=](ParameterLabelItem* detLabel) { + const auto addResolutionFunction = [&](ParameterLabelItem* detLabel) { if (auto* r = dynamic_cast<ResolutionFunction2DGaussianItem*>( detector->resolutionFunctionSelection().currentItem())) { auto* label = new ParameterLabelItem("Resolution (Gaussian)", detLabel); diff --git a/GUI/Model/Sample/MaterialModel.cpp b/GUI/Model/Sample/MaterialModel.cpp index b307a63c1e34551c55a8ddb6af4addc070339864..4871b99aad55e4756592c8e7dba3d5c21d22556f 100644 --- a/GUI/Model/Sample/MaterialModel.cpp +++ b/GUI/Model/Sample/MaterialModel.cpp @@ -84,7 +84,7 @@ MaterialItem* MaterialModel::addMaterialItem(MaterialItem* materialItem, bool si ASSERT(materialItem); materialItem->disconnect(this); m_materials << materialItem; - connect(materialItem, &MaterialItem::dataChanged, this, [=] { emit materialChanged(); }); + connect(materialItem, &MaterialItem::dataChanged, this, [&] { emit materialChanged(); }); if (signalAdding) emit materialAddedOrRemoved(); diff --git a/GUI/Support/Util/WidgetMoverButton.cpp b/GUI/Support/Util/WidgetMoverButton.cpp index f079f90ac751811f3bb8d2d88b467cdf5591fe56..e8cabd1eab48cd7b041af66c2265d436ec25829d 100644 --- a/GUI/Support/Util/WidgetMoverButton.cpp +++ b/GUI/Support/Util/WidgetMoverButton.cpp @@ -145,12 +145,12 @@ void WidgetMoverButton::mouseMoveEvent(QMouseEvent* event) if (parPos.y() < 20) { m_dragScrollTimer.setInterval(10); m_dragScrollTimer.disconnect(); - connect(&m_dragScrollTimer, &QTimer::timeout, [=]() { scrollParent(true); }); + connect(&m_dragScrollTimer, &QTimer::timeout, [&]() { scrollParent(true); }); m_dragScrollTimer.start(); } else if (parPos.y() > m_scrollArea->height() - 20) { m_dragScrollTimer.setInterval(10); m_dragScrollTimer.disconnect(); - connect(&m_dragScrollTimer, &QTimer::timeout, [=]() { scrollParent(false); }); + connect(&m_dragScrollTimer, &QTimer::timeout, [&]() { scrollParent(false); }); m_dragScrollTimer.start(); } else m_dragScrollTimer.stop(); diff --git a/GUI/View/Common/DataAccessWidget.cpp b/GUI/View/Common/DataAccessWidget.cpp index 915196d97ffe363ec2fbc1d3acff56bba46a3c41..ec0e867e8d5f8e0c74be785cc9dd0a24626e253a 100644 --- a/GUI/View/Common/DataAccessWidget.cpp +++ b/GUI/View/Common/DataAccessWidget.cpp @@ -31,7 +31,7 @@ void DataAccessWidget::setJobOrRealItem(QObject* item) ASSERT(jobItem() || realItem()); disconnect(m_item, &QObject::destroyed, this, nullptr); - connect(m_item, &QObject::destroyed, this, [=]() { m_item = nullptr; }); + connect(m_item, &QObject::destroyed, this, [&]() { m_item = nullptr; }); } void DataAccessWidget::setFourierItem(IntensityDataItem* fftItem) diff --git a/GUI/View/Common/IntensityDataPropertyWidget.cpp b/GUI/View/Common/IntensityDataPropertyWidget.cpp index 2eeba28ba4838f23a36158d4d767967a45a80bac..ec03c6e50510d0e111d46386fd12f9c4dd6f28cf 100644 --- a/GUI/View/Common/IntensityDataPropertyWidget.cpp +++ b/GUI/View/Common/IntensityDataPropertyWidget.cpp @@ -53,8 +53,8 @@ void IntensityDataPropertyWidget::createPanelElements() m_mainLayout->addRow("Axes units:", GUI::Util::createUnitsComboBox( axesUnitsList(), - [=] { return currentIntensityDataItem()->currentAxesUnits(); }, - [=](const QString& newVal) { + [&] { return currentIntensityDataItem()->currentAxesUnits(); }, + [&](const QString& newVal) { for (auto item : allIntensityDataItems()) item->setCurrentAxesUnits(newVal); emit axesRangeResetRequested(); @@ -64,8 +64,8 @@ void IntensityDataPropertyWidget::createPanelElements() m_mainLayout->addRow( "Color scheme:", - GUI::Util::createComboBox([=] { return currentIntensityDataItem()->gradientCombo(); }, - [=](const QString& newVal) { + GUI::Util::createComboBox([&] { return currentIntensityDataItem()->gradientCombo(); }, + [&](const QString& newVal) { for (auto item : allIntensityDataItems()) item->setCurrentGradient(newVal); gProjectDocument.value()->setModified(); @@ -73,8 +73,8 @@ void IntensityDataPropertyWidget::createPanelElements() &m_updaters)); m_mainLayout->addRow(GUI::Util::createCheckBox( - "Interpolate", [=] { return currentIntensityDataItem()->isInterpolated(); }, - [=](bool b) { + "Interpolate", [&] { return currentIntensityDataItem()->isInterpolated(); }, + [&](bool b) { for (auto item : allIntensityDataItems()) item->setInterpolated(b); gProjectDocument.value()->setModified(); @@ -88,8 +88,8 @@ void IntensityDataPropertyWidget::createPanelElements() xFormLayout->setSpacing(5); xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox( - [=] { return currentIntensityDataItem()->xAxisItem()->min(); }, - [=](double newValue) { + [&] { return currentIntensityDataItem()->xAxisItem()->min(); }, + [&](double newValue) { for (auto item : allIntensityDataItems()) item->xAxisItem()->setMin(newValue); gProjectDocument.value()->setModified(); @@ -97,8 +97,8 @@ void IntensityDataPropertyWidget::createPanelElements() &m_updaters)); xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox( - [=] { return currentIntensityDataItem()->xAxisItem()->max(); }, - [=](double newValue) { + [&] { return currentIntensityDataItem()->xAxisItem()->max(); }, + [&](double newValue) { for (auto item : allIntensityDataItems()) item->xAxisItem()->setMax(newValue); gProjectDocument.value()->setModified(); @@ -107,8 +107,8 @@ void IntensityDataPropertyWidget::createPanelElements() xFormLayout->addRow( "Title:", - GUI::Util::createTextEdit([=] { return currentIntensityDataItem()->xAxisItem()->title(); }, - [=](QString newText) { + GUI::Util::createTextEdit([&] { return currentIntensityDataItem()->xAxisItem()->title(); }, + [&](QString newText) { for (auto item : allIntensityDataItems()) item->xAxisItem()->setTitle(newText); gProjectDocument.value()->setModified(); @@ -124,8 +124,8 @@ void IntensityDataPropertyWidget::createPanelElements() yFormLayout->setSpacing(5); yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox( - [=] { return currentIntensityDataItem()->yAxisItem()->min(); }, - [=](double newValue) { + [&] { return currentIntensityDataItem()->yAxisItem()->min(); }, + [&](double newValue) { for (auto item : allIntensityDataItems()) item->yAxisItem()->setMin(newValue); gProjectDocument.value()->setModified(); @@ -133,8 +133,8 @@ void IntensityDataPropertyWidget::createPanelElements() &m_updaters)); yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox( - [=] { return currentIntensityDataItem()->yAxisItem()->max(); }, - [=](double newValue) { + [&] { return currentIntensityDataItem()->yAxisItem()->max(); }, + [&](double newValue) { for (auto item : allIntensityDataItems()) item->yAxisItem()->setMax(newValue); gProjectDocument.value()->setModified(); @@ -143,8 +143,8 @@ void IntensityDataPropertyWidget::createPanelElements() yFormLayout->addRow( "Title:", - GUI::Util::createTextEdit([=] { return currentIntensityDataItem()->yAxisItem()->title(); }, - [=](QString newText) { + GUI::Util::createTextEdit([&] { return currentIntensityDataItem()->yAxisItem()->title(); }, + [&](QString newText) { for (auto item : allIntensityDataItems()) item->yAxisItem()->setTitle(newText); gProjectDocument.value()->setModified(); @@ -160,8 +160,8 @@ void IntensityDataPropertyWidget::createPanelElements() zFormLayout->setSpacing(5); zFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox( - [=] { return currentIntensityDataItem()->zAxisItem()->min(); }, - [=](double newValue) { + [&] { return currentIntensityDataItem()->zAxisItem()->min(); }, + [&](double newValue) { for (auto item : allIntensityDataItems()) item->zAxisItem()->setMin(newValue); gProjectDocument.value()->setModified(); @@ -169,8 +169,8 @@ void IntensityDataPropertyWidget::createPanelElements() &m_updaters)); zFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox( - [=] { return currentIntensityDataItem()->zAxisItem()->max(); }, - [=](double newValue) { + [&] { return currentIntensityDataItem()->zAxisItem()->max(); }, + [&](double newValue) { for (auto item : mainIntensityDataItems()) item->zAxisItem()->setMax(newValue); gProjectDocument.value()->setModified(); @@ -178,8 +178,8 @@ void IntensityDataPropertyWidget::createPanelElements() &m_updaters)); zFormLayout->addRow(GUI::Util::createCheckBox( - "log10", [=] { return currentIntensityDataItem()->zAxisItem()->isLogScale(); }, - [=](bool b) { + "log10", [&] { return currentIntensityDataItem()->zAxisItem()->isLogScale(); }, + [&](bool b) { for (auto item : allIntensityDataItems()) item->zAxisItem()->setLogScale(b); gProjectDocument.value()->setModified(); @@ -187,8 +187,8 @@ void IntensityDataPropertyWidget::createPanelElements() &m_updaters)); zFormLayout->addRow(GUI::Util::createCheckBox( - "Visible", [=] { return currentIntensityDataItem()->zAxisItem()->isVisible(); }, - [=](bool b) { + "Visible", [&] { return currentIntensityDataItem()->zAxisItem()->isVisible(); }, + [&](bool b) { for (auto item : allIntensityDataItems()) item->zAxisItem()->setVisible(b); gProjectDocument.value()->setModified(); diff --git a/GUI/View/Device/AxisPropertyForm.cpp b/GUI/View/Device/AxisPropertyForm.cpp index 6ab3c182a552926621c94bb512fe4e8154d0479a..179af0b7ec3735d089208382464dbcbbc39f8e8a 100644 --- a/GUI/View/Device/AxisPropertyForm.cpp +++ b/GUI/View/Device/AxisPropertyForm.cpp @@ -27,8 +27,8 @@ AxisPropertyForm::AxisPropertyForm(QWidget* parent, const QString& groupTitle, auto* formLayout = new QFormLayout(this); formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); - m_nbinsSpinBox = GUI::Util::createIntSpinbox([=] { return axisProperty->nbins(); }, - [=](int v) { + m_nbinsSpinBox = GUI::Util::createIntSpinbox([&] { return axisProperty->nbins(); }, + [&](int v) { axisProperty->setNbins(v); emit dataChanged(); gProjectDocument.value()->setModified(); @@ -45,7 +45,7 @@ AxisPropertyForm::AxisPropertyForm(QWidget* parent, const QString& groupTitle, connect(collapser, &GroupBoxCollapser::toggled, this, [this](bool b) { m_axisProperty->setExpandGroupBox(b); }); - connect(m_minSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [=](double v) { + connect(m_minSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [&](double v) { if (m_axisProperty->min() != v) { m_axisProperty->setMin(v); emit dataChanged(); @@ -56,7 +56,7 @@ AxisPropertyForm::AxisPropertyForm(QWidget* parent, const QString& groupTitle, } }); - connect(m_maxSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [=](double v) { + connect(m_maxSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [&](double v) { if (m_axisProperty->max() != v) { m_axisProperty->setMax(v); emit dataChanged(); diff --git a/GUI/View/Device/BackgroundForm.cpp b/GUI/View/Device/BackgroundForm.cpp index ad4e280f0608b683d127f19f6133e7132366731d..6b9ec1bcac8b8a8d6715fe9d3e2fbb507f1d0815 100644 --- a/GUI/View/Device/BackgroundForm.cpp +++ b/GUI/View/Device/BackgroundForm.cpp @@ -28,7 +28,7 @@ BackgroundForm::BackgroundForm(QWidget* parent, InstrumentItem* instrument) m_formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); auto* backgroundTypeCombo = - GUI::Util::createComboBoxFromProperty(instrument->backgroundSelection(), [=](int) { + GUI::Util::createComboBoxFromProperty(instrument->backgroundSelection(), [&](int) { createBackgroundWidgets(); emit dataChanged(); }); @@ -52,7 +52,7 @@ void BackgroundForm::createBackgroundWidgets() spinbox->setSingleStep(0.01); m_formLayout->addRow("Background value:", spinbox); - connect(spinbox, &DoubleSpinBox::baseValueChanged, [=](double newValue) { + connect(spinbox, &DoubleSpinBox::baseValueChanged, [&](double newValue) { p->setBackgroundValue(newValue); emit dataChanged(); }); diff --git a/GUI/View/Device/DetectorAlignmentForm.cpp b/GUI/View/Device/DetectorAlignmentForm.cpp index 3e679ada1da90d9beb6a0a940c993665fa67e64f..287299c8d5c51329f6d763522c1a3b1088af36a0 100644 --- a/GUI/View/Device/DetectorAlignmentForm.cpp +++ b/GUI/View/Device/DetectorAlignmentForm.cpp @@ -47,8 +47,8 @@ DetectorAlignmentForm::DetectorAlignmentForm(QWidget* parent, RectangularDetecto m_formLayout->setSpacing(8); m_formLayout->addRow( - "Alignment:", GUI::Util::createSafeComboBox([=] { return item->detectorAlignmentCombo(); }, - [=](const QString& t) { + "Alignment:", GUI::Util::createSafeComboBox([&] { return item->detectorAlignmentCombo(); }, + [&](const QString& t) { item->setDetectorAlignment(t); createAligmentWidgets(); emit dataChanged(); diff --git a/GUI/View/Device/FootprintForm.cpp b/GUI/View/Device/FootprintForm.cpp index 883e7e3cdce6c8434b17b6ce635f4599b16efbb1..75d6b5548f91db492b04d74e4ebd53fc37d54c9a 100644 --- a/GUI/View/Device/FootprintForm.cpp +++ b/GUI/View/Device/FootprintForm.cpp @@ -27,7 +27,7 @@ FootprintForm::FootprintForm(QWidget* parent, ScanItem* item) ASSERT(item); m_formLayout = new QFormLayout(this); m_formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); - auto* typeCombo = GUI::Util::createComboBoxFromProperty(item->footprintSelection(), [=](int) { + auto* typeCombo = GUI::Util::createComboBoxFromProperty(item->footprintSelection(), [&](int) { createFootprintWidgets(); emit dataChanged(); }); @@ -51,7 +51,7 @@ void FootprintForm::createFootprintWidgets() auto* spinbox = new DoubleSpinBox(square->squareFootprintValue()); spinbox->setSingleStep(0.01); m_formLayout->addRow("Width ratio:", spinbox); - connect(spinbox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [=](double newValue) { + connect(spinbox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [&](double newValue) { square->setSquareFootprintValue(newValue); emit dataChanged(); }); @@ -59,7 +59,7 @@ void FootprintForm::createFootprintWidgets() auto* spinbox = new DoubleSpinBox(gauss->gaussianFootprintValue()); spinbox->setSingleStep(0.01); m_formLayout->addRow("Width ratio:", spinbox); - connect(spinbox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [=](double newValue) { + connect(spinbox, qOverload<double>(&DoubleSpinBox::baseValueChanged), [&](double newValue) { gauss->setGaussianFootprintValue(newValue); emit dataChanged(); }); diff --git a/GUI/View/Device/RectangularDetectorForm.cpp b/GUI/View/Device/RectangularDetectorForm.cpp index c5269b29713ba0287d8488303ccba6e8d07da373..c6688f4617a134b1cffd584ac38d5a6cfab3c72a 100644 --- a/GUI/View/Device/RectangularDetectorForm.cpp +++ b/GUI/View/Device/RectangularDetectorForm.cpp @@ -43,13 +43,13 @@ RectangularDetectorForm::RectangularDetectorForm(QWidget* parent, RectangularDet auto* widthSpinBox = new DoubleSpinBox(detector->width()); xAxisFormLayout->addRow("Width [mm]:", widthSpinBox); - connect(xAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](int newValue) { + connect(xAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [&](int newValue) { detector->setXSize(newValue); emit dataChanged(); }); connect(widthSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), - [=](double newValue) { + [&](double newValue) { detector->setWidth(newValue); emit dataChanged(); }); @@ -72,13 +72,13 @@ RectangularDetectorForm::RectangularDetectorForm(QWidget* parent, RectangularDet auto* heightSpinBox = new DoubleSpinBox(detector->height()); yAxisFormLayout->addRow("Height [mm]:", heightSpinBox); - connect(yAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [=](int newValue) { + connect(yAxisNbinsSpinBox, qOverload<int>(&QSpinBox::valueChanged), [&](int newValue) { detector->setYSize(newValue); emit dataChanged(); }); connect(heightSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), - [=](double newValue) { + [&](double newValue) { detector->setHeight(newValue); emit dataChanged(); }); diff --git a/GUI/View/Device/ResolutionForm.cpp b/GUI/View/Device/ResolutionForm.cpp index 39fbbd0de540cac2d93b07e6ff45482e3122fcc8..3870b7b0cff3535411f3a4173afca22cb6561416 100644 --- a/GUI/View/Device/ResolutionForm.cpp +++ b/GUI/View/Device/ResolutionForm.cpp @@ -29,7 +29,7 @@ ResolutionForm::ResolutionForm(Unit unit, QWidget* parent, DetectorItem* item) m_formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); auto* typeCombo = - GUI::Util::createComboBoxFromProperty(item->resolutionFunctionSelection(), [=](int) { + GUI::Util::createComboBoxFromProperty(item->resolutionFunctionSelection(), [&](int) { createResolutionWidgets(); emit dataChanged(); }); @@ -54,13 +54,13 @@ void ResolutionForm::createResolutionWidgets() auto* sigmaYSpinBox = GUI::Util::createDoubleSpinBoxRow(m_formLayout, p->sigmaY()); connect(sigmaXSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), - [=](double newValue) { + [&](double newValue) { p->setSigmaX(newValue); emit dataChanged(); }); connect(sigmaYSpinBox, qOverload<double>(&DoubleSpinBox::baseValueChanged), - [=](double newValue) { + [&](double newValue) { p->setSigmaY(newValue); emit dataChanged(); }); diff --git a/GUI/View/Fit/FitParameterWidget.cpp b/GUI/View/Fit/FitParameterWidget.cpp index af0b0c39f2f2acd54498e57d91e2a2208ddd9a8a..5b0f16291fd0e9f7d25e45c7ab4ae85b62535857 100644 --- a/GUI/View/Fit/FitParameterWidget.cpp +++ b/GUI/View/Fit/FitParameterWidget.cpp @@ -118,7 +118,7 @@ void FitParameterWidget::onTuningWidgetContextMenu(const QPoint& point) addToFitParMenu->setEnabled(false); for (int i = 0; i < fitParNames.count(); ++i) { auto* action = new QAction(QString("to ").append(fitParNames.at(i)), addToFitParMenu); - connect(action, &QAction::triggered, [=] { onAddToFitParAction(i); }); + connect(action, &QAction::triggered, [&] { onAddToFitParAction(i); }); addToFitParMenu->addAction(action); } } diff --git a/GUI/View/Fit/FitSessionManager.cpp b/GUI/View/Fit/FitSessionManager.cpp index 93760537ad8301ae7511d0d5b24bcdf57adfa981..3526a892baab8e0641b47ea9474134cadbacbf6f 100644 --- a/GUI/View/Fit/FitSessionManager.cpp +++ b/GUI/View/Fit/FitSessionManager.cpp @@ -48,7 +48,7 @@ FitSessionController* FitSessionManager::sessionController(JobItem* jobItem) FitSessionController* FitSessionManager::createController(JobItem* jobItem) { - connect(jobItem, &JobItem::destroyed, this, [=]() { removeController(jobItem); }); + connect(jobItem, &JobItem::destroyed, this, [&]() { removeController(jobItem); }); auto* result = new FitSessionController(this); result->setJobItem(jobItem); diff --git a/GUI/View/Fit/MinimizerSettingsWidget.cpp b/GUI/View/Fit/MinimizerSettingsWidget.cpp index dbe866aa06ad230a06b06da6e5f725f648fc38d2..6b19fd146d661d0032cdf807fc3bf38f32afc03e 100644 --- a/GUI/View/Fit/MinimizerSettingsWidget.cpp +++ b/GUI/View/Fit/MinimizerSettingsWidget.cpp @@ -57,8 +57,8 @@ void MinimizerSettingsWidget::setMinContainerItem(MinimizerContainerItem* contai m_mainLayout->addRow("Objective metric:", GUI::Util::createComboBox( - [=] { return m_containerItem->objectiveMetricCombo(); }, - [=](const QString& t) { + [&] { return m_containerItem->objectiveMetricCombo(); }, + [&](const QString& t) { m_containerItem->setCurrentObjectiveMetric(t); gProjectDocument.value()->setModified(); }, @@ -67,8 +67,8 @@ void MinimizerSettingsWidget::setMinContainerItem(MinimizerContainerItem* contai "and experimental data")); m_mainLayout->addRow("Norm function:", GUI::Util::createComboBox( - [=] { return m_containerItem->normFunctionCombo(); }, - [=](const QString& t) { + [&] { return m_containerItem->normFunctionCombo(); }, + [&](const QString& t) { m_containerItem->setCurrentNormFunction(t); gProjectDocument.value()->setModified(); }, @@ -120,7 +120,7 @@ void MinimizerSettingsWidget::createGroupedAlgorithmsCombo() // action comboBox->setProperty("previous", comboBox->currentIndex()); - QObject::connect(comboBox, &QComboBox::currentTextChanged, [=] { + QObject::connect(comboBox, &QComboBox::currentTextChanged, [&] { // skip headers while scrolling if (header_indices.contains(comboBox->currentIndex())) { int previous_state = comboBox->property("previous").toInt(); @@ -144,7 +144,7 @@ void MinimizerSettingsWidget::createGroupedAlgorithmsCombo() }); // update state - m_updaters << [=]() { + m_updaters << [&]() { QSignalBlocker b(comboBox); comboBox->setCurrentText(m_containerItem->commonAlgorithmCombo().currentValue()); }; @@ -183,8 +183,8 @@ void MinimizerSettingsWidget::createMinuitEdits() m_minimizerLayout->addRow( "Strategy:", - GUI::Util::createIntSpinbox([=] { return minItem->strategy(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return minItem->strategy(); }, + [&](int v) { minItem->setStrategy(v); gProjectDocument.value()->setModified(); }, @@ -194,8 +194,8 @@ void MinimizerSettingsWidget::createMinuitEdits() m_minimizerLayout->addRow( "ErrorDef factor:", - GUI::Util::createDoubleSpinbox([=] { return minItem->errorDefinition(); }, - [=](double v) { + GUI::Util::createDoubleSpinbox([&] { return minItem->errorDefinition(); }, + [&](double v) { minItem->setErrorDefinition(v); gProjectDocument.value()->setModified(); }, @@ -205,8 +205,8 @@ void MinimizerSettingsWidget::createMinuitEdits() m_minimizerLayout->addRow("Tolerance:", GUI::Util::createDoubleSpinbox( - [=] { return minItem->tolerance(); }, - [=](double v) { + [&] { return minItem->tolerance(); }, + [&](double v) { minItem->setTolerance(v); gProjectDocument.value()->setModified(); }, @@ -215,8 +215,8 @@ void MinimizerSettingsWidget::createMinuitEdits() m_minimizerLayout->addRow( "Precision:", - GUI::Util::createDoubleSpinbox([=] { return minItem->precision(); }, - [=](double v) { + GUI::Util::createDoubleSpinbox([&] { return minItem->precision(); }, + [&](double v) { minItem->setPrecision(v); gProjectDocument.value()->setModified(); }, @@ -225,8 +225,8 @@ void MinimizerSettingsWidget::createMinuitEdits() m_minimizerLayout->addRow( "Max func calls:", - GUI::Util::createIntSpinbox([=] { return minItem->maxFuncCalls(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return minItem->maxFuncCalls(); }, + [&](int v) { minItem->setMaxFuncCalls(v); gProjectDocument.value()->setModified(); }, @@ -240,8 +240,8 @@ void MinimizerSettingsWidget::createGSLMultiMinEdits() m_minimizerLayout->addRow( "Max iterations:", - GUI::Util::createIntSpinbox([=] { return minItem->maxIterations(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return minItem->maxIterations(); }, + [&](int v) { minItem->setMaxIterations(v); gProjectDocument.value()->setModified(); }, @@ -255,8 +255,8 @@ void MinimizerSettingsWidget::createTMVAGeneticEdits() m_minimizerLayout->addRow("Tolerance:", GUI::Util::createDoubleSpinbox( - [=] { return minItem->tolerance(); }, - [=](double v) { + [&] { return minItem->tolerance(); }, + [&](double v) { minItem->setTolerance(v); gProjectDocument.value()->setModified(); }, @@ -265,8 +265,8 @@ void MinimizerSettingsWidget::createTMVAGeneticEdits() m_minimizerLayout->addRow( "Max iterations:", - GUI::Util::createIntSpinbox([=] { return minItem->maxIterations(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return minItem->maxIterations(); }, + [&](int v) { minItem->setMaxIterations(v); gProjectDocument.value()->setModified(); }, @@ -274,8 +274,8 @@ void MinimizerSettingsWidget::createTMVAGeneticEdits() &m_updaters, true /*easy scroll*/)); m_minimizerLayout->addRow( - "Population:", GUI::Util::createIntSpinbox([=] { return minItem->populationSize(); }, - [=](int v) { + "Population:", GUI::Util::createIntSpinbox([&] { return minItem->populationSize(); }, + [&](int v) { minItem->setPopulationSize(v); gProjectDocument.value()->setModified(); }, @@ -283,8 +283,8 @@ void MinimizerSettingsWidget::createTMVAGeneticEdits() &m_updaters, true /*easy scroll*/)); m_minimizerLayout->addRow("Random seed:", GUI::Util::createIntSpinbox( - [=] { return minItem->randomSeed(); }, - [=](int v) { + [&] { return minItem->randomSeed(); }, + [&](int v) { minItem->setRandomSeed(v); gProjectDocument.value()->setModified(); }, @@ -298,8 +298,8 @@ void MinimizerSettingsWidget::createGSLSimulatedAnnealingEdits() SimAnMinimizerItem* minItem = m_containerItem->minimizerItemSimAn(); m_minimizerLayout->addRow( - "Max iterations:", GUI::Util::createIntSpinbox([=] { return minItem->maxIterations(); }, - [=](int v) { + "Max iterations:", GUI::Util::createIntSpinbox([&] { return minItem->maxIterations(); }, + [&](int v) { minItem->setMaxIterations(v); gProjectDocument.value()->setModified(); }, @@ -309,8 +309,8 @@ void MinimizerSettingsWidget::createGSLSimulatedAnnealingEdits() m_minimizerLayout->addRow( "Iterations at T:", - GUI::Util::createIntSpinbox([=] { return minItem->iterationsAtEachTemp(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return minItem->iterationsAtEachTemp(); }, + [&](int v) { minItem->setIterationsAtEachTemp(v); gProjectDocument.value()->setModified(); }, @@ -319,8 +319,8 @@ void MinimizerSettingsWidget::createGSLSimulatedAnnealingEdits() true /*easy scroll*/)); m_minimizerLayout->addRow("Step size:", GUI::Util::createDoubleSpinbox( - [=] { return minItem->stepSize(); }, - [=](double v) { + [&] { return minItem->stepSize(); }, + [&](double v) { minItem->setStepSize(v); gProjectDocument.value()->setModified(); }, @@ -328,16 +328,16 @@ void MinimizerSettingsWidget::createGSLSimulatedAnnealingEdits() RealLimits::nonnegative())); m_minimizerLayout->addRow("k:", GUI::Util::createDoubleSpinbox( - [=] { return minItem->boltzmanK(); }, - [=](double v) { + [&] { return minItem->boltzmanK(); }, + [&](double v) { minItem->setBoltzmanK(v); gProjectDocument.value()->setModified(); }, &m_updaters, "Boltzmann k", RealLimits::nonnegative())); m_minimizerLayout->addRow( - "T init:", GUI::Util::createDoubleSpinbox([=] { return minItem->boltzmanInitT(); }, - [=](double v) { + "T init:", GUI::Util::createDoubleSpinbox([&] { return minItem->boltzmanInitT(); }, + [&](double v) { minItem->setBoltzmanInitT(v); gProjectDocument.value()->setModified(); }, @@ -345,16 +345,16 @@ void MinimizerSettingsWidget::createGSLSimulatedAnnealingEdits() RealLimits::nonnegative())); m_minimizerLayout->addRow("mu:", GUI::Util::createDoubleSpinbox( - [=] { return minItem->boltzmanMu(); }, - [=](double v) { + [&] { return minItem->boltzmanMu(); }, + [&](double v) { minItem->setBoltzmanMu(v); gProjectDocument.value()->setModified(); }, &m_updaters, "Boltzmann mu", RealLimits::nonnegative())); m_minimizerLayout->addRow( - "T min:", GUI::Util::createDoubleSpinbox([=] { return minItem->boltzmanMinT(); }, - [=](double v) { + "T min:", GUI::Util::createDoubleSpinbox([&] { return minItem->boltzmanMinT(); }, + [&](double v) { minItem->setBoltzmanMinT(v); gProjectDocument.value()->setModified(); }, @@ -368,8 +368,8 @@ void MinimizerSettingsWidget::createGSLLevMarEdits() m_minimizerLayout->addRow("Tolerance:", GUI::Util::createDoubleSpinbox( - [=] { return minItem->tolerance(); }, - [=](double v) { + [&] { return minItem->tolerance(); }, + [&](double v) { minItem->setTolerance(v); gProjectDocument.value()->setModified(); }, @@ -378,8 +378,8 @@ void MinimizerSettingsWidget::createGSLLevMarEdits() m_minimizerLayout->addRow( "Max iterations:", - GUI::Util::createIntSpinbox([=] { return minItem->maxIterations(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return minItem->maxIterations(); }, + [&](int v) { minItem->setMaxIterations(v); gProjectDocument.value()->setModified(); }, diff --git a/GUI/View/Fit/ParameterTuningWidget.cpp b/GUI/View/Fit/ParameterTuningWidget.cpp index 36d132ca9ea164869893f414866ea813d6c4beb8..08667686aac983478539aa37d792c00a344b5e29 100644 --- a/GUI/View/Fit/ParameterTuningWidget.cpp +++ b/GUI/View/Fit/ParameterTuningWidget.cpp @@ -79,7 +79,7 @@ void ParameterTuningWidget::setJobOrRealItem(QObject* job_item) updateDragAndDropSettings(); connect(jobItem(), &JobItem::jobStatusChanged, this, - [=](const JobStatus) { updateJobStatus(); }); + [&](const JobStatus) { updateJobStatus(); }); updateJobStatus(); } diff --git a/GUI/View/Import/RealDataSelectorWidget.cpp b/GUI/View/Import/RealDataSelectorWidget.cpp index 443a700246b95e37d326499a2a32fe9e25d13f66..d5a3dcbe0716a2102bb68bed06d1a78a8e349ddd 100644 --- a/GUI/View/Import/RealDataSelectorWidget.cpp +++ b/GUI/View/Import/RealDataSelectorWidget.cpp @@ -118,7 +118,7 @@ RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent, ProjectDocument* restoreSelection(); ItemViewOverlayButtons::install( - m_itemTree, [=](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); + m_itemTree, [&](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); } QSize RealDataSelectorWidget::sizeHint() const @@ -193,7 +193,7 @@ QList<QAction*> RealDataSelectorWidget::getOverlayActions(const QModelIndex& ind removeAction->setIcon(QIcon(":/images/delete.svg")); removeAction->setIconText("Remove"); removeAction->setToolTip("Remove this data"); - connect(removeAction, &QAction::triggered, [=]() { + connect(removeAction, &QAction::triggered, [&]() { m_itemTreeModel->removeItem(item); gProjectDocument.value()->setModified(); }); diff --git a/GUI/View/Import/RealDataTreeModel.cpp b/GUI/View/Import/RealDataTreeModel.cpp index 390be810582b4d5ae66f0ec8b8dd061521f5de80..77bdafe5721adbce6448b53c4e64878815fcb4ab 100644 --- a/GUI/View/Import/RealDataTreeModel.cpp +++ b/GUI/View/Import/RealDataTreeModel.cpp @@ -304,11 +304,11 @@ void RealDataTreeModel::updateSubscriptions() { for (auto* item : m_items[0]) connect(item, &RealItem::importContentsProcessed, this, - [=]() { onContentsProcessed(item); }); + [&]() { onContentsProcessed(item); }); for (auto* item : m_items[1]) connect(item, &RealItem::importContentsProcessed, this, - [=]() { onContentsProcessed(item); }); + [&]() { onContentsProcessed(item); }); } void RealDataTreeModel::onContentsProcessed(RealItem* item) diff --git a/GUI/View/Import/SpecularDataImportWidget.cpp b/GUI/View/Import/SpecularDataImportWidget.cpp index 2ebe617171e25b1caf148cd0fbdbf8c006a87c6d..49399baa9d72423e464f457aac588e7cbbe27090 100644 --- a/GUI/View/Import/SpecularDataImportWidget.cpp +++ b/GUI/View/Import/SpecularDataImportWidget.cpp @@ -107,12 +107,12 @@ void SpecularDataImportWidget::onPlotAxisClicked(QCPAxis* axis, QCPAxis::Selecta QMenu menu; auto* lin = new QAction("Linear"); - connect(lin, &QAction::triggered, [=]() { realSpecularDataItem()->setLog(false); }); + connect(lin, &QAction::triggered, [&]() { realSpecularDataItem()->setLog(false); }); lin->setCheckable(true); lin->setChecked(!realSpecularDataItem()->isLog()); auto* log = new QAction("Logarithmic"); - connect(log, &QAction::triggered, [=]() { realSpecularDataItem()->setLog(true); }); + connect(log, &QAction::triggered, [&]() { realSpecularDataItem()->setLog(true); }); log->setCheckable(true); log->setChecked(realSpecularDataItem()->isLog()); diff --git a/GUI/View/Info/CautionSign.cpp b/GUI/View/Info/CautionSign.cpp index 36dc1ce93629431ab20e1d1170c81df1e57caf55..8e660ba552758bf3cced1b9363f228de3232ff5d 100644 --- a/GUI/View/Info/CautionSign.cpp +++ b/GUI/View/Info/CautionSign.cpp @@ -46,7 +46,7 @@ void CautionSign::clear() m_caution_message.clear(); m_clear_just_had_happened = true; - QTimer::singleShot(10, this, [=]() { m_clear_just_had_happened = false; }); + QTimer::singleShot(10, this, [&]() { m_clear_just_had_happened = false; }); } void CautionSign::setCautionHeader(const QString& cautionHeader) @@ -63,7 +63,7 @@ void CautionSign::setCautionMessage(const QString& cautionMessage) if (m_clear_just_had_happened) { m_clear_just_had_happened = false; - QTimer::singleShot(50, this, [=]() { setCautionMessage(cautionMessage); }); + QTimer::singleShot(50, this, [&]() { setCautionMessage(cautionMessage); }); } else { m_caution_message = cautionMessage; diff --git a/GUI/View/Instrument/DetectorEditor.cpp b/GUI/View/Instrument/DetectorEditor.cpp index 1633dfa31a0af4716d7f72818a40ef64decf0527..345221f1b822d628824fe2ac2efe7f56981e6b70 100644 --- a/GUI/View/Instrument/DetectorEditor.cpp +++ b/GUI/View/Instrument/DetectorEditor.cpp @@ -30,7 +30,7 @@ DetectorEditor::DetectorEditor(QWidget* parent, GISASInstrumentItem* instrument) m_formLayout = new QFormLayout(this); auto* detectorTypeCombo = - GUI::Util::createComboBoxFromProperty(instrument->detectorSelection(), [=](int) { + GUI::Util::createComboBoxFromProperty(instrument->detectorSelection(), [&](int) { createDetectorWidgets(); emit dataChanged(); }); diff --git a/GUI/View/Instrument/DistributionEditor.cpp b/GUI/View/Instrument/DistributionEditor.cpp index a2ecace63c41c90c59ce834244bb568c811ec1b8..b8393a9be08de1971d490db746605cef2fa7e0b3 100644 --- a/GUI/View/Instrument/DistributionEditor.cpp +++ b/GUI/View/Instrument/DistributionEditor.cpp @@ -39,7 +39,7 @@ DistributionSelector::DistributionSelector(std::optional<MeanConfig> mean_config m_formLayout->setContentsMargins(0, 0, 0, 0); m_distributionCombo = - GUI::Util::createComboBoxFromProperty(item->distributionSelection(), [=](int) { + GUI::Util::createComboBoxFromProperty(item->distributionSelection(), [&](int) { createDistributionWidgets(); emit distributionChanged(); }); @@ -60,13 +60,13 @@ void DistributionSelector::createDistributionWidgets() } else if (auto* it = dynamic_cast<DistributionGateItem*>(m_item->distributionItem())) { auto* minSpinbox = createSpinBox(it->minimum()); auto* maxSpinbox = createSpinBox(it->maximum()); - connect(minSpinbox, &DoubleSpinBox::baseValueChanged, [=](double d) { + connect(minSpinbox, &DoubleSpinBox::baseValueChanged, [&](double d) { if (d > it->maximum()) { it->setMaximum(d); maxSpinbox->updateValue(); } }); - connect(maxSpinbox, &DoubleSpinBox::baseValueChanged, [=](double d) { + connect(maxSpinbox, &DoubleSpinBox::baseValueChanged, [&](double d) { if (d < it->minimum()) { it->setMinimum(d); minSpinbox->updateValue(); @@ -103,8 +103,8 @@ void DistributionSelector::createNumSamplesSpinBox(DistributionItem* dist) { ASSERT(dist); m_formLayout->addRow("Number of samples:", - GUI::Util::createIntSpinbox([=] { return dist->numberOfSamples(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return dist->numberOfSamples(); }, + [&](int v) { dist->setNumberOfSamples(v); emit distributionChanged(); }, diff --git a/GUI/View/Instrument/GISASBeamEditor.cpp b/GUI/View/Instrument/GISASBeamEditor.cpp index f63383c1c3bebb0a2886d43d43e5b506c4795e45..825de7462c8d3668b1b2748a0ea46d7c9d10cdcd 100644 --- a/GUI/View/Instrument/GISASBeamEditor.cpp +++ b/GUI/View/Instrument/GISASBeamEditor.cpp @@ -70,7 +70,7 @@ GISASBeamEditor::GISASBeamEditor(QWidget* parent, BeamItem* item) &GISASBeamEditor::dataChanged); // validate value while typing - connect(intensityEditor, &QLineEdit::textEdited, [=]() { + connect(intensityEditor, &QLineEdit::textEdited, [&]() { QString str = intensityEditor->text(); int pos; if (intensityEditor->validator()->validate(str, pos) == QValidator::Acceptable) { @@ -80,7 +80,7 @@ GISASBeamEditor::GISASBeamEditor(QWidget* parent, BeamItem* item) }); // if validator does not assert the input value, it says about that, // and here we return to the last correct value - connect(validator, &FixupDoubleValidator::fixupSignal, [=]() { + connect(validator, &FixupDoubleValidator::fixupSignal, [&]() { auto* editor = qobject_cast<QLineEdit*>(validator->parent()); editor->setText(QString::number(item->intensity(), 'g')); }); diff --git a/GUI/View/Instrument/InstrumentLibraryEditor.cpp b/GUI/View/Instrument/InstrumentLibraryEditor.cpp index ae84ce12e77b3f14b491c4a62f7d461439189ae9..ae21ea3d277b8470448ecba36268de0c9169cf9c 100644 --- a/GUI/View/Instrument/InstrumentLibraryEditor.cpp +++ b/GUI/View/Instrument/InstrumentLibraryEditor.cpp @@ -97,7 +97,7 @@ InstrumentItem* InstrumentLibraryEditor::execChoose() setWindowTitle("Instrument Library - Choose instrument"); ItemViewOverlayButtons::install( - m_ui->treeView, [=](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); + m_ui->treeView, [&](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); m_ui->treeView->setItemDelegate(new ItemDelegateForHTML(this)); connect(m_ui->treeView, &QTreeView::doubleClicked, this, @@ -123,7 +123,7 @@ void InstrumentLibraryEditor::execAdd(const InstrumentItem& instrumentToAdd) m_treeModel->setTypeEnabled(TreeModel::instrumentType(addedInstrument), true); ItemViewOverlayButtons::install( - m_ui->treeView, [=](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); + m_ui->treeView, [&](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); m_ui->treeView->setItemDelegate(new ItemDelegateForHTML(this)); connect(m_ui->treeView->selectionModel(), &QItemSelectionModel::currentChanged, this, &InstrumentLibraryEditor::createWidgetsForCurrentInstrument); @@ -172,7 +172,7 @@ QList<QAction*> InstrumentLibraryEditor::getOverlayActions(const QModelIndex& in removeAction->setIcon(QIcon(":/images/delete.svg")); removeAction->setIconText("Remove"); removeAction->setToolTip("Remove this instrument"); - connect(removeAction, &QAction::triggered, [=]() { m_treeModel->removeItem(item); }); + connect(removeAction, &QAction::triggered, [&]() { m_treeModel->removeItem(item); }); return {removeAction}; } @@ -210,7 +210,7 @@ void InstrumentLibraryEditor::createWidgetsForCurrentInstrument() descriptionEdit->setPlainText(currentInstrument->description()); formLayout->addRow("Description:", descriptionEdit); connect(descriptionEdit, &QTextEdit::textChanged, - [=]() { onInstrumentDescriptionEdited(descriptionEdit->toPlainText()); }); + [&]() { onInstrumentDescriptionEdited(descriptionEdit->toPlainText()); }); GroupBoxCollapser::installIntoGroupBox(g); diff --git a/GUI/View/Instrument/InstrumentView.cpp b/GUI/View/Instrument/InstrumentView.cpp index a435e93f793aebd7e145ab4d1b5469607bb3405a..536fde8b601cda133aca329c54bf7e2ec50b9c36 100644 --- a/GUI/View/Instrument/InstrumentView.cpp +++ b/GUI/View/Instrument/InstrumentView.cpp @@ -116,7 +116,7 @@ void InstrumentView::createWidgetsForCurrentInstrument() descriptionEdit->setPlainText(currentInstrument->description()); formLayout->addRow("Description:", descriptionEdit); connect(descriptionEdit, &QTextEdit::textChanged, - [=]() { onInstrumentdescriptionEdited(descriptionEdit->toPlainText()); }); + [&]() { onInstrumentdescriptionEdited(descriptionEdit->toPlainText()); }); auto* collapser = GroupBoxCollapser::installIntoGroupBox(g); collapser->setExpanded(currentInstrument->isExpandInfo()); diff --git a/GUI/View/Instrument/PolarizationAnalysisEditor.cpp b/GUI/View/Instrument/PolarizationAnalysisEditor.cpp index 04e53ce67054808ef44d08f10af680a36008d170..17bc01c6442878a0a1da8b47b2fc123ed94f9fa8 100644 --- a/GUI/View/Instrument/PolarizationAnalysisEditor.cpp +++ b/GUI/View/Instrument/PolarizationAnalysisEditor.cpp @@ -45,7 +45,7 @@ PolarizationAnalysisEditor::PolarizationAnalysisEditor(QWidget* parent, Instrume layout->addWidget(polarizerAnalyzerWidget); polarizerAnalyzerWidget->setVisible(m_instrument->withPolarizerAnalyzer()); - connect(checkbox, &QCheckBox::toggled, [=](bool b) { + connect(checkbox, &QCheckBox::toggled, [&](bool b) { polarizerAnalyzerWidget->setVisible(b); m_instrument->setWithPolarizerAnalyzer(b); emit dataChanged(); diff --git a/GUI/View/Instrument/ScanEditor.cpp b/GUI/View/Instrument/ScanEditor.cpp index 3f8b1c2d3ea93efac5b0c15e032addfe1e2e72d2..9c4ca468a22586d4c1ee52bcff614cd856228a84 100644 --- a/GUI/View/Instrument/ScanEditor.cpp +++ b/GUI/View/Instrument/ScanEditor.cpp @@ -78,7 +78,7 @@ ScanEditor::ScanEditor(QWidget* parent, ScanItem* item, InstrumentNotifier* ec) connect(footprintEditor, &FootprintForm::dataChanged, this, &ScanEditor::dataChanged); // validate value while typing - connect(intensityLineEdit, &QLineEdit::textEdited, [=]() { + connect(intensityLineEdit, &QLineEdit::textEdited, [&]() { QString str = intensityLineEdit->text(); int pos; if (intensityLineEdit->validator()->validate(str, pos) == QValidator::Acceptable) { @@ -88,7 +88,7 @@ ScanEditor::ScanEditor(QWidget* parent, ScanItem* item, InstrumentNotifier* ec) }); // if validator does not assert the input value, it says about that, // and here we return to the last correct value - connect(validator, &FixupDoubleValidator::fixupSignal, [=]() { + connect(validator, &FixupDoubleValidator::fixupSignal, [&]() { auto* editor = qobject_cast<QLineEdit*>(validator->parent()); editor->setText(QString::number(item->intensity(), 'g')); }); diff --git a/GUI/View/Job/JobListModel.cpp b/GUI/View/Job/JobListModel.cpp index 1dcd665c9b66f2b3191ac0255f9ff134ad10a6c6..08fdd5ed3a9928f9c1d337ec3d1fbc8672bc8e87 100644 --- a/GUI/View/Job/JobListModel.cpp +++ b/GUI/View/Job/JobListModel.cpp @@ -120,13 +120,13 @@ void JobListModel::onJobAdded() void JobListModel::enableJobNotification(JobItem* job) { // name - connect(job, &JobItem::jobNameChanged, this, [=]() { emitJobListModelChanged(job); }); + connect(job, &JobItem::jobNameChanged, this, [&]() { emitJobListModelChanged(job); }); // status - connect(job, &JobItem::jobStatusChanged, this, [=]() { emitJobListModelChanged(job); }); + connect(job, &JobItem::jobStatusChanged, this, [&]() { emitJobListModelChanged(job); }); // progress - connect(job, &JobItem::jobProgressChanged, this, [=]() { emitJobListModelChanged(job); }); + connect(job, &JobItem::jobProgressChanged, this, [&]() { emitJobListModelChanged(job); }); } void JobListModel::disableJobNotification(JobItem* job) diff --git a/GUI/View/Job/JobPropertiesTableModel.cpp b/GUI/View/Job/JobPropertiesTableModel.cpp index 3a85463a14010576bbf94c4417e4665677236267..5d21ec821460d7c1aa5cb1598f0471d5107d7111 100644 --- a/GUI/View/Job/JobPropertiesTableModel.cpp +++ b/GUI/View/Job/JobPropertiesTableModel.cpp @@ -144,25 +144,25 @@ void JobPropertiesTableModel::setJobItem(JobItem* jobItem) void JobPropertiesTableModel::notifyJobPropertyChange() { // name - connect(m_item, &JobItem::jobNameChanged, this, [=](const QString&) { + connect(m_item, &JobItem::jobNameChanged, this, [&](const QString&) { emit dataChanged(index(Row::Name, Column::Value), index(Row::Name, Column::Value), {Qt::DisplayRole, Qt::EditRole}); }); // status - connect(m_item, &JobItem::jobStatusChanged, this, [=](const JobStatus) { + connect(m_item, &JobItem::jobStatusChanged, this, [&](const JobStatus) { emit dataChanged(index(Row::Status, Column::Value), index(Row::Status, Column::Value), {Qt::DisplayRole, Qt::EditRole}); }); // begin time - connect(m_item, &JobItem::jobBeginTimeChanged, this, [=](const QDateTime&) { + connect(m_item, &JobItem::jobBeginTimeChanged, this, [&](const QDateTime&) { emit dataChanged(index(Row::Begin, Column::Value), index(Row::Begin, Column::Value), {Qt::DisplayRole, Qt::EditRole}); }); // end time and duration - connect(m_item, &JobItem::jobEndTimeChanged, this, [=](const QDateTime&) { + connect(m_item, &JobItem::jobEndTimeChanged, this, [&](const QDateTime&) { emit dataChanged(index(Row::End, Column::Value), index(Row::Duration, Column::Value), {Qt::DisplayRole, Qt::EditRole}); }); diff --git a/GUI/View/Job/JobPropertiesWidget.cpp b/GUI/View/Job/JobPropertiesWidget.cpp index e0745c28be3e13c9c9a8f5e183956f3fbac93cbd..55292d28ae9d37b6eadd57256f27b6a52cfab0cc 100644 --- a/GUI/View/Job/JobPropertiesWidget.cpp +++ b/GUI/View/Job/JobPropertiesWidget.cpp @@ -101,7 +101,7 @@ void JobPropertiesWidget::setJobItem(JobItem* jobItem) void JobPropertiesWidget::notifyJobPropertyChange() { - connect(m_jobItem, &JobItem::jobCommentsChanged, this, [=](const QString&) { + connect(m_jobItem, &JobItem::jobCommentsChanged, this, [&](const QString&) { if (m_jobItem && m_jobItem->comments() != m_commentsEditor->toPlainText()) { m_commentsEditor->blockSignals(true); m_commentsEditor->setPlainText(m_jobItem->comments()); diff --git a/GUI/View/Job/JobView.cpp b/GUI/View/Job/JobView.cpp index 2435d875746d4214bf046d3ccad8539f8c7539fb..d55dd84da9ce1579de243422336c71a7cf33c195 100644 --- a/GUI/View/Job/JobView.cpp +++ b/GUI/View/Job/JobView.cpp @@ -132,7 +132,7 @@ void JobView::createActions() auto* action = new QAction(this); action->setText(JobViewActivities::nameFromActivity(activity)); action->setCheckable(true); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, [&]() { // apply activity to JobView setActivity(activity); // store activity in JobItem diff --git a/GUI/View/Loaders/QREDataLoaderProperties.cpp b/GUI/View/Loaders/QREDataLoaderProperties.cpp index 57c54ce3f42adb8a712e5d52643411f80128e7c3..4ee0e675ffa27588de878b83bb3930588ba19906 100644 --- a/GUI/View/Loaders/QREDataLoaderProperties.cpp +++ b/GUI/View/Loaders/QREDataLoaderProperties.cpp @@ -25,29 +25,29 @@ QREDataLoaderProperties::QREDataLoaderProperties() allowFactors(false); - connect(m_ui->headerPrefixEdit, &QLineEdit::textChanged, [=]() { emit propertiesChanged(); }); - connect(m_ui->linesToSkipEdit, &QLineEdit::textChanged, [=]() { emit propertiesChanged(); }); + connect(m_ui->headerPrefixEdit, &QLineEdit::textChanged, [&]() { emit propertiesChanged(); }); + connect(m_ui->linesToSkipEdit, &QLineEdit::textChanged, [&]() { emit propertiesChanged(); }); connect(m_ui->separatorCombo, &QComboBox::currentTextChanged, - [=]() { emit propertiesChanged(); }); + [&]() { emit propertiesChanged(); }); connect(m_ui->enableErrorCheckBox, &QCheckBox::stateChanged, this, &QREDataLoaderProperties::onErrorEnablingChanged); connect(m_ui->qUnitCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), - [=]() { emit propertiesChanged(); }); + [&]() { emit propertiesChanged(); }); for (int dataType = 0; dataType < 3; dataType++) { // In the following: disable the checkbox before signaling propertyChanged to suppress ghost // value changes in case the propertiesChanged signals triggers long calculations (the // spinbox would see a timeout in its "pressed"-loop and generate a second value change) - connect(columnSpinBox(dataType), QOverload<int>::of(&QSpinBox::valueChanged), [=]() { + connect(columnSpinBox(dataType), QOverload<int>::of(&QSpinBox::valueChanged), [&]() { columnSpinBox(dataType)->setEnabled(false); emit propertiesChanged(); columnSpinBox(dataType)->setEnabled(true); }); connect(factorSpinBox(dataType), QOverload<double>::of(&QDoubleSpinBox::valueChanged), - [=]() { + [&]() { factorSpinBox(dataType)->setEnabled(false); emit propertiesChanged(); factorSpinBox(dataType)->setEnabled(true); diff --git a/GUI/View/Main/AboutDialog.cpp b/GUI/View/Main/AboutDialog.cpp index f1c8be752f3eb60e623693fe31961f17ef5720f7..9a6f20a84e2d43345107e45e0a4f192925924baf 100644 --- a/GUI/View/Main/AboutDialog.cpp +++ b/GUI/View/Main/AboutDialog.cpp @@ -153,6 +153,6 @@ AboutDialog::AboutDialog(QWidget* parent) static const char mydata[] = {0x64, 0x65, 0x76, 0x73}; QByteArray b = QByteArray::fromRawData(mydata, sizeof(mydata)); auto* f = new ShortcodeFilter(b, this); - connect(f, &ShortcodeFilter::found, parent, [=]() { layout()->addWidget(createLogoLabel()); }); + connect(f, &ShortcodeFilter::found, parent, [&]() { layout()->addWidget(createLogoLabel()); }); installEventFilter(f); } diff --git a/GUI/View/Main/ActionManager.cpp b/GUI/View/Main/ActionManager.cpp index 51c69872f22b6c37f0eeb5d27cc2ff152acd93f3..56fbbfd2f814c062b75a80217d96eabe89681274 100644 --- a/GUI/View/Main/ActionManager.cpp +++ b/GUI/View/Main/ActionManager.cpp @@ -240,13 +240,13 @@ void ActionManager::onAboutToShowSettingsMenu() auto* styleMenu = m_settingsMenu->addMenu("Interface Style"); auto* styleGroup = new QButtonGroup(this); styleGroup->setExclusive(true); - const auto addStyleAction = [=](const QString& text, ApplicationSettings::Style style) { + const auto addStyleAction = [&](const QString& text, ApplicationSettings::Style style) { auto* action = new QWidgetAction(styleMenu); auto* radioButton = new QRadioButton(text, styleMenu); radioButton->setStyleSheet(""); action->setDefaultWidget(radioButton); radioButton->setChecked(appSettings->currentStyle() == style); - connect(radioButton, &QRadioButton::toggled, this, [=]() { + connect(radioButton, &QRadioButton::toggled, this, [&]() { appSettings->setStyleToUse(style); appSettings->loadStyle(style); }); diff --git a/GUI/View/Mask/MaskEditorPropertyPanel.cpp b/GUI/View/Mask/MaskEditorPropertyPanel.cpp index 9d24d45c86ae1e9dfa2bad13ce3bbee20b6236f5..0965269a329987f647941a67be82156c22e06837 100644 --- a/GUI/View/Mask/MaskEditorPropertyPanel.cpp +++ b/GUI/View/Mask/MaskEditorPropertyPanel.cpp @@ -178,7 +178,7 @@ void MaskEditorPropertyPanel::createMaskEditorUI() } // -- mask visibility const auto visibilityValueGetter = [maskItem] { return maskItem->isVisibleValue(); }; - const auto visibilityValueSetter = [=](bool b) { + const auto visibilityValueSetter = [&](bool b) { m_inhibitSelectionChange = true; maskItem->setIsVisibleValue(b); m_inhibitSelectionChange = false; @@ -245,7 +245,7 @@ void MaskEditorPropertyPanel::addMaskSpinBox(const QString& label, function<doub setter(newVal); gProjectDocument.value()->setModified(); }); - connect(m_currentMaskItem, &MaskItem::maskGeometryChanged, spinBox, [=] { + connect(m_currentMaskItem, &MaskItem::maskGeometryChanged, spinBox, [&] { QSignalBlocker b(spinBox); spinBox->setValue(getter()); }); diff --git a/GUI/View/Numeric/NumWidgetUtil.cpp b/GUI/View/Numeric/NumWidgetUtil.cpp index 6e6e5f846ba084e2f82621498f1ee9316a5e2d7e..de389c30659aabb69d8ab954fab23144b9418636 100644 --- a/GUI/View/Numeric/NumWidgetUtil.cpp +++ b/GUI/View/Numeric/NumWidgetUtil.cpp @@ -44,10 +44,10 @@ QComboBox* GUI::Util::createComboBox(function<ComboProperty()> comboFunction, if (!isScrollable) WheelEventEater::install(combo); - QObject::connect(combo, &QComboBox::currentTextChanged, [=] { slot(combo->currentText()); }); + QObject::connect(combo, &QComboBox::currentTextChanged, [&] { slot(combo->currentText()); }); if (updaters) - (*updaters) << [=]() { + (*updaters) << [&]() { QSignalBlocker b(combo); combo->setCurrentText(comboFunction().currentValue()); }; @@ -74,10 +74,10 @@ QComboBox* GUI::Util::createUnitsComboBox(const QStringList& list, function<QStr if (!isScrollable) WheelEventEater::install(combo); - QObject::connect(combo, &QComboBox::currentTextChanged, [=] { slot(combo->currentText()); }); + QObject::connect(combo, &QComboBox::currentTextChanged, [&] { slot(combo->currentText()); }); if (updaters) - (*updaters) << [=]() { + (*updaters) << [&]() { QSignalBlocker b(combo); combo->setCurrentText(currentUnits()); }; @@ -92,7 +92,7 @@ DoubleSpinBox* GUI::Util::createDoubleSpinBoxRow(QFormLayout* parentLayout, Doub parentLayout->addRow(labelWithUnit(d.label(), d.unit()) + ":", sb); if (slot) - QObject::connect(sb, &DoubleSpinBox::baseValueChanged, [=](int v) { slot(v); }); + QObject::connect(sb, &DoubleSpinBox::baseValueChanged, [&](int v) { slot(v); }); return sb; } @@ -126,7 +126,7 @@ ScientificSpinBox* GUI::Util::createScientificSpinBox(QFormLayout* parentLayout, parentLayout->addRow(labelWithUnit(d.label(), d.unit()) + ":", spinBox); if (slot) - QObject::connect(spinBox, &ScientificSpinBox::valueChanged, [=](double v) { slot(v); }); + QObject::connect(spinBox, &ScientificSpinBox::valueChanged, [&](double v) { slot(v); }); return spinBox; } @@ -137,10 +137,10 @@ QCheckBox* GUI::Util::createCheckBox(const QString& title, function<bool()> gett QCheckBox* checkBox = new QCheckBox(title); checkBox->setChecked(getter()); - QObject::connect(checkBox, &QCheckBox::stateChanged, [=]() { setter(checkBox->isChecked()); }); + QObject::connect(checkBox, &QCheckBox::stateChanged, [&]() { setter(checkBox->isChecked()); }); if (updaters) - (*updaters) << [=]() { + (*updaters) << [&]() { QSignalBlocker b(checkBox); checkBox->setChecked(getter()); }; @@ -154,10 +154,10 @@ QLineEdit* GUI::Util::createTextEdit(function<QString()> getter, function<void(Q QLineEdit* edit = new QLineEdit; edit->setText(getter()); - QObject::connect(edit, &QLineEdit::textEdited, [=]() { setter(edit->text()); }); + QObject::connect(edit, &QLineEdit::textEdited, [&]() { setter(edit->text()); }); if (updaters) - (*updaters) << [=]() { + (*updaters) << [&]() { QSignalBlocker b(edit); edit->setText(getter()); }; @@ -182,10 +182,10 @@ QSpinBox* GUI::Util::createIntSpinbox(std::function<int()> getter, std::function if (!easyScrollable) WheelEventEater::install(spin); - QObject::connect(spin, qOverload<int>(&QSpinBox::valueChanged), [=] { slot(spin->value()); }); + QObject::connect(spin, qOverload<int>(&QSpinBox::valueChanged), [&] { slot(spin->value()); }); if (updaters) - (*updaters) << [=]() { + (*updaters) << [&]() { QSignalBlocker b(spin); spin->setValue(getter()); }; @@ -213,10 +213,10 @@ QDoubleSpinBox* GUI::Util::createDoubleSpinbox(function<double()> getter, WheelEventEater::install(spin); QObject::connect(spin, qOverload<double>(&QDoubleSpinBox::valueChanged), - [=] { slot(spin->value()); }); + [&] { slot(spin->value()); }); if (updaters) - (*updaters) << [=]() { + (*updaters) << [&]() { QSignalBlocker b(spin); spin->setValue(getter()); }; diff --git a/GUI/View/PlotComparison/FitComparisonWidget.cpp b/GUI/View/PlotComparison/FitComparisonWidget.cpp index 48c3e114927895e056b43c473448a77554a5a03e..226b973c916b2cb8a6a9d54238b541a99cd03709 100644 --- a/GUI/View/PlotComparison/FitComparisonWidget.cpp +++ b/GUI/View/PlotComparison/FitComparisonWidget.cpp @@ -131,7 +131,7 @@ void FitComparisonWidget::connectItems() // sync Z range between sumulated and real connect(simuIntensityDataItem(), &IntensityDataItem::alignRanges, - [=] { GUI::View::RangeUtil::setCommonRangeZ(mainIntensityDataItems()); }); + [&] { GUI::View::RangeUtil::setCommonRangeZ(mainIntensityDataItems()); }); // sync Z range: simu --> real connect(simuIntensityDataItem(), &DataItem::updateOtherPlots, realIntensityDataItem(), diff --git a/GUI/View/PlotSpecular/SpecularDataPropertyWidget.cpp b/GUI/View/PlotSpecular/SpecularDataPropertyWidget.cpp index 9f99f20ecbf780da5601a43b6ae191a4a71e9756..ec3bb82079608c6fa92f8846d0d8a5b6e3354c22 100644 --- a/GUI/View/PlotSpecular/SpecularDataPropertyWidget.cpp +++ b/GUI/View/PlotSpecular/SpecularDataPropertyWidget.cpp @@ -45,8 +45,8 @@ void SpecularDataPropertyWidget::createPanelElements() m_mainLayout->addRow("Axes units:", GUI::Util::createUnitsComboBox( axesUnitsList(), - [=] { return currentSpecularDataItem()->currentAxesUnits(); }, - [=](const QString& newVal) { + [&] { return currentSpecularDataItem()->currentAxesUnits(); }, + [&](const QString& newVal) { for (auto item : allSpecularDataItems()) item->setCurrentAxesUnits(newVal); emit axesRangeResetRequested(); @@ -61,8 +61,8 @@ void SpecularDataPropertyWidget::createPanelElements() xFormLayout->setSpacing(5); xFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox( - [=] { return currentSpecularDataItem()->xAxisItem()->min(); }, - [=](double newValue) { + [&] { return currentSpecularDataItem()->xAxisItem()->min(); }, + [&](double newValue) { for (auto item : allSpecularDataItems()) item->xAxisItem()->setMin(newValue); gProjectDocument.value()->setModified(); @@ -70,8 +70,8 @@ void SpecularDataPropertyWidget::createPanelElements() &m_updaters)); xFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox( - [=] { return currentSpecularDataItem()->xAxisItem()->max(); }, - [=](double newValue) { + [&] { return currentSpecularDataItem()->xAxisItem()->max(); }, + [&](double newValue) { for (auto item : allSpecularDataItems()) item->xAxisItem()->setMax(newValue); gProjectDocument.value()->setModified(); @@ -80,8 +80,8 @@ void SpecularDataPropertyWidget::createPanelElements() xFormLayout->addRow( "Title:", - GUI::Util::createTextEdit([=] { return currentSpecularDataItem()->xAxisItem()->title(); }, - [=](QString newText) { + GUI::Util::createTextEdit([&] { return currentSpecularDataItem()->xAxisItem()->title(); }, + [&](QString newText) { for (auto item : allSpecularDataItems()) item->xAxisItem()->setTitle(newText); gProjectDocument.value()->setModified(); @@ -97,8 +97,8 @@ void SpecularDataPropertyWidget::createPanelElements() yFormLayout->setSpacing(5); yFormLayout->addRow("Min:", GUI::Util::createDoubleSpinbox( - [=] { return currentSpecularDataItem()->yAxisItem()->min(); }, - [=](double newValue) { + [&] { return currentSpecularDataItem()->yAxisItem()->min(); }, + [&](double newValue) { for (auto item : mainSpecularDataItems()) item->yAxisItem()->setMin(newValue); gProjectDocument.value()->setModified(); @@ -106,8 +106,8 @@ void SpecularDataPropertyWidget::createPanelElements() &m_updaters)); yFormLayout->addRow("Max:", GUI::Util::createDoubleSpinbox( - [=] { return currentSpecularDataItem()->yAxisItem()->max(); }, - [=](double newValue) { + [&] { return currentSpecularDataItem()->yAxisItem()->max(); }, + [&](double newValue) { for (auto item : mainSpecularDataItems()) item->yAxisItem()->setMax(newValue); gProjectDocument.value()->setModified(); @@ -116,8 +116,8 @@ void SpecularDataPropertyWidget::createPanelElements() yFormLayout->addRow( "Title:", - GUI::Util::createTextEdit([=] { return currentSpecularDataItem()->yAxisItem()->title(); }, - [=](QString newText) { + GUI::Util::createTextEdit([&] { return currentSpecularDataItem()->yAxisItem()->title(); }, + [&](QString newText) { for (auto item : mainSpecularDataItems()) item->yAxisItem()->setTitle(newText); gProjectDocument.value()->setModified(); @@ -125,8 +125,8 @@ void SpecularDataPropertyWidget::createPanelElements() &m_updaters)); yFormLayout->addRow(GUI::Util::createCheckBox( - "log10", [=] { return currentSpecularDataItem()->yAxisItem()->isLogScale(); }, - [=](bool b) { + "log10", [&] { return currentSpecularDataItem()->yAxisItem()->isLogScale(); }, + [&](bool b) { for (auto item : allSpecularDataItems()) item->yAxisItem()->setLogScale(b); gProjectDocument.value()->setModified(); diff --git a/GUI/View/Projection/IntensityDataProjectionsWidget.cpp b/GUI/View/Projection/IntensityDataProjectionsWidget.cpp index 6dfc13c7a6d86b8807019d2fc5ce6cda90add23e..83b33c0cc4cb1d48f86499eed76241e6fce92059 100644 --- a/GUI/View/Projection/IntensityDataProjectionsWidget.cpp +++ b/GUI/View/Projection/IntensityDataProjectionsWidget.cpp @@ -116,7 +116,7 @@ void IntensityDataProjectionsWidget::setup_connections() // tool panel request is propagated from editorActions to this MaskEditor connect(m_editorActions, &ProjectionsEditorActions::propertyPanelRequest, - [=]() { m_propertyPanel->setHidden(!m_propertyPanel->isHidden()); }); + [&]() { m_propertyPanel->setHidden(!m_propertyPanel->isHidden()); }); // selection/drawing activity is propagated from Toolbar to graphics scene connect(m_toolbar, &ProjectionsToolbar::activityModeChanged, m_projectionsCanvas, diff --git a/GUI/View/PropertyEditor/CustomEditors.cpp b/GUI/View/PropertyEditor/CustomEditors.cpp index a68ea3f9f3d2839b9652de2f4f8bcb6c4e8b68c7..ef93188537b7315a446aa9fdb4a283a013590650 100644 --- a/GUI/View/PropertyEditor/CustomEditors.cpp +++ b/GUI/View/PropertyEditor/CustomEditors.cpp @@ -150,7 +150,7 @@ ScientificSpinBoxEditor::ScientificSpinBoxEditor(QWidget* parent) layout->addWidget(m_doubleEditor); - connect(m_doubleEditor, &ScientificSpinBox::valueChanged, [=] { this->onEditingFinished(); }); + connect(m_doubleEditor, &ScientificSpinBox::valueChanged, [&] { this->onEditingFinished(); }); setLayout(layout); diff --git a/GUI/View/PropertyEditor/PropertyEditorFactory.cpp b/GUI/View/PropertyEditor/PropertyEditorFactory.cpp index 9465d920c6b41f0373383744f1f29018483d9a09..c06e834c17d428344df12af90b79186d51b024fb 100644 --- a/GUI/View/PropertyEditor/PropertyEditorFactory.cpp +++ b/GUI/View/PropertyEditor/PropertyEditorFactory.cpp @@ -85,7 +85,7 @@ QWidget* GUI::View::PropertyEditorFactory::CreateEditor(QObject* item, QWidget* result->setParent(parent); QObject::connect(result, &CustomEditor::dataChanged, - [=] { gProjectDocument.value()->setModified(); }); + [&] { gProjectDocument.value()->setModified(); }); } return result; diff --git a/GUI/View/SampleDesigner/CompoundForm.cpp b/GUI/View/SampleDesigner/CompoundForm.cpp index c0dfe6f36cc86061f77a7910aa3d33e1ed3f6c89..c891e125a51138ee8e1821cfd87321fb703bcbe6 100644 --- a/GUI/View/SampleDesigner/CompoundForm.cpp +++ b/GUI/View/SampleDesigner/CompoundForm.cpp @@ -41,8 +41,8 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compositionItem, LayerEditorUtil::createWidgetForItemWithParticles(this, particle, false, ec)); auto* btn = LayerEditorUtil::createAddParticleButton( - this, [=](FormFactorItemCatalog::Type type) { ec->addCompoundItem(compositionItem, type); }, - [=](ItemWithParticlesCatalog::Type type) { ec->addCompoundItem(compositionItem, type); }); + this, [&](FormFactorItemCatalog::Type type) { ec->addCompoundItem(compositionItem, type); }, + [&](ItemWithParticlesCatalog::Type type) { ec->addCompoundItem(compositionItem, type); }); m_structureEditingWidgets << btn; layouter.addStructureEditingRow(btn); @@ -53,12 +53,12 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compositionItem, [compositionItem](bool b) { compositionItem->setExpandCompound(b); }); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "particle composition", [=] { ec->requestViewInRealspace(compositionItem); }); + this, "particle composition", [&] { ec->requestViewInRealspace(compositionItem); }); collapser->addAction(showInRealspaceAction); if (allowRemove) { m_removeAction = ActionFactory::createRemoveAction( - this, "particle composition", [=] { ec->removeParticle(compositionItem); }); + this, "particle composition", [&] { ec->removeParticle(compositionItem); }); collapser->addAction(m_removeAction); } diff --git a/GUI/View/SampleDesigner/CoreAndShellForm.cpp b/GUI/View/SampleDesigner/CoreAndShellForm.cpp index 899c7df38a6c0c3a4d2b57be27de53b142f0eb94..f6f77960cfcd1821dfd5dfab57355e104a326e22 100644 --- a/GUI/View/SampleDesigner/CoreAndShellForm.cpp +++ b/GUI/View/SampleDesigner/CoreAndShellForm.cpp @@ -125,13 +125,13 @@ CoreAndShellForm::CoreAndShellForm(QWidget* parent, CoreAndShellItem* item, [item](bool b) { item->setExpandMain(b); }); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "core/shell particle", [=] { ec->requestViewInRealspace(item); }); + this, "core/shell particle", [&] { ec->requestViewInRealspace(item); }); mainCollapser->addAction(showInRealspaceAction); if (allowRemove) { m_removeAction = ActionFactory::createRemoveAction(this, "core/shell particle", - [=] { ec->removeParticle(item); }); + [&] { ec->removeParticle(item); }); mainCollapser->addAction(m_removeAction); } } diff --git a/GUI/View/SampleDesigner/InterferenceForm.cpp b/GUI/View/SampleDesigner/InterferenceForm.cpp index 16bd8a10aa4df65f606713b1253fc162ec913bc5..7ab90fdec6e9a3fe6c377ef389fdc5bc70944991 100644 --- a/GUI/View/SampleDesigner/InterferenceForm.cpp +++ b/GUI/View/SampleDesigner/InterferenceForm.cpp @@ -52,7 +52,7 @@ InterferenceForm::InterferenceForm(QWidget* parent, ParticleLayoutItem* layoutIt updateTitle(); connect(m_interferenceTypeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), - [=](int newIndex) { m_ec->selectInterference(this, newIndex); }); + [&](int newIndex) { m_ec->selectInterference(this, newIndex); }); } ParticleLayoutItem* InterferenceForm::layoutItem() const @@ -109,16 +109,16 @@ void InterferenceForm::createInterferenceWidgets() } else if (auto* itf = dynamic_cast<InterferenceFinite2DLatticeItem*>(interference)) { layouter.addValue(itf->positionVariance()); layouter.addRow("Domain size 1:", - GUI::Util::createIntSpinbox([=] { return itf->domainSize1(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return itf->domainSize1(); }, + [&](int v) { itf->setDomainSize1(v); emit m_ec->modified(); }, RealLimits::lowerLimited(1), "Domain size 1 in number of unit cells")); layouter.addRow("Domain size 2:", - GUI::Util::createIntSpinbox([=] { return itf->domainSize2(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return itf->domainSize2(); }, + [&](int v) { itf->setDomainSize2(v); emit m_ec->modified(); }, diff --git a/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp b/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp index 09f60cea9feb0ff131d638c6089ccf3a6e833f3c..17a002e72742d3dbce93dc7546f2734f5a5196a5 100644 --- a/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp +++ b/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp @@ -44,7 +44,7 @@ void LatticeTypeSelectionForm::createContent() m_integrateOverXiCheckBox->setChecked(m_interferenceItem->xiIntegration()); m_gridLayout->addWidget(m_integrateOverXiCheckBox, 1, m_gridLayout->columnCount()); connect(m_integrateOverXiCheckBox, &QCheckBox::stateChanged, - [=] { m_ec->setIntegrateOverXi(this, m_integrateOverXiCheckBox->isChecked()); }); + [&] { m_ec->setIntegrateOverXi(this, m_integrateOverXiCheckBox->isChecked()); }); const int colOfXiLabel = m_gridLayout->columnCount(); LayerEditorUtil::addMultiPropertyToGrid(m_gridLayout, m_gridLayout->columnCount(), diff --git a/GUI/View/SampleDesigner/LayerEditorUtil.cpp b/GUI/View/SampleDesigner/LayerEditorUtil.cpp index 5602222f93b3b552b5ac6d8c5de763d9ecbb2d0a..63685f276d450662d233ec42f89a5bcc50530544 100644 --- a/GUI/View/SampleDesigner/LayerEditorUtil.cpp +++ b/GUI/View/SampleDesigner/LayerEditorUtil.cpp @@ -217,7 +217,7 @@ QPushButton* LayerEditorUtil::createAddParticleButton( const auto ui = FormFactorItemCatalog::uiInfo(type); QAction* a = menuForEntries->addAction(QIcon(ui.iconPath), ui.menuEntry); a->setToolTip(ui.description); - QObject::connect(a, &QAction::triggered, [=]() { slotAddFormFactor(type); }); + QObject::connect(a, &QAction::triggered, [&]() { slotAddFormFactor(type); }); } group("Ripples"); @@ -225,7 +225,7 @@ QPushButton* LayerEditorUtil::createAddParticleButton( const auto ui = FormFactorItemCatalog::uiInfo(type); QAction* a = menuForEntries->addAction(QIcon(ui.iconPath), ui.menuEntry); a->setToolTip(ui.description); - QObject::connect(a, &QAction::triggered, [=]() { slotAddFormFactor(type); }); + QObject::connect(a, &QAction::triggered, [&]() { slotAddFormFactor(type); }); } group("Particle assemblies"); @@ -235,7 +235,7 @@ QPushButton* LayerEditorUtil::createAddParticleButton( const auto ui = ItemWithParticlesCatalog::uiInfo(type); QAction* a = menuForEntries->addAction(QIcon(ui.iconPath), ui.menuEntry); a->setToolTip(ui.description); - QObject::connect(a, &QAction::triggered, [=]() { slotAddParticle(type); }); + QObject::connect(a, &QAction::triggered, [&]() { slotAddParticle(type); }); } btn->setMenu(menu); diff --git a/GUI/View/SampleDesigner/LayerForm.cpp b/GUI/View/SampleDesigner/LayerForm.cpp index e218c2449a3782edb3cb0c905c5dbab24566ba82..0eed5f9a11cab31b83a6710e292134262943c902 100644 --- a/GUI/View/SampleDesigner/LayerForm.cpp +++ b/GUI/View/SampleDesigner/LayerForm.cpp @@ -43,7 +43,7 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController* [layer](bool b) { layer->setExpandLayer(b); }); m_removeAction = - ActionFactory::createRemoveAction(this, "layer", [=] { ec->removeLayerItem(layer); }); + ActionFactory::createRemoveAction(this, "layer", [&] { ec->removeLayerItem(layer); }); auto* chooseColorAction = new QAction(this); chooseColorAction->setText("Choose color"); @@ -57,7 +57,7 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController* QPixmap p(64, 64); p.fill(col); auto* ca = menu->addAction(QIcon(p), ""); - connect(ca, &QAction::triggered, [=]() { + connect(ca, &QAction::triggered, [&]() { layer->setColor(col); updateColor(); }); @@ -71,7 +71,7 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController* &SampleEditorController::onStoppedToMoveLayer); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "layer", [=] { m_ec->requestViewInRealspace(layer); }); + this, "layer", [&] { m_ec->requestViewInRealspace(layer); }); m_collapser->addAction(showInRealspaceAction); m_collapser->addAction(chooseColorAction); @@ -86,8 +86,8 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController* m_thicknessRow = m_layouter->addValue(m_layer->thickness()); m_layouter->addRow("Number of slices:", - GUI::Util::createIntSpinbox([=] { return m_layer->numSlices(); }, - [=](int v) { + GUI::Util::createIntSpinbox([&] { return m_layer->numSlices(); }, + [&](int v) { m_layer->setNumSlices(v); emit m_ec->modified(); }, @@ -104,7 +104,7 @@ LayerForm::LayerForm(QWidget* parent, LayerItem* layer, SampleEditorController* // -- Button for adding a new layout auto* btn = new QPushButton("Add particle layout", this); - connect(btn, &QPushButton::clicked, [=] { ec->addLayoutItem(this); }); + connect(btn, &QPushButton::clicked, [&] { ec->addLayoutItem(this); }); m_structureEditingWidgets << btn; m_layouter->addStructureEditingRow(btn); diff --git a/GUI/View/SampleDesigner/MesocrystalForm.cpp b/GUI/View/SampleDesigner/MesocrystalForm.cpp index 0cc94fd9f0cb7f0498dea1168217f4f1e02927e9..48990d32c2dd5f92b04af2145dfcec6b0115fee8 100644 --- a/GUI/View/SampleDesigner/MesocrystalForm.cpp +++ b/GUI/View/SampleDesigner/MesocrystalForm.cpp @@ -54,12 +54,12 @@ MesocrystalForm::MesocrystalForm(QWidget* parent, MesocrystalItem* item, SampleE [item](bool b) { item->setExpandMesocrystal(b); }); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "meso crystal", [=] { ec->requestViewInRealspace(item); }); + this, "meso crystal", [&] { ec->requestViewInRealspace(item); }); collapser->addAction(showInRealspaceAction); if (allowRemove) { m_removeAction = ActionFactory::createRemoveAction(this, "meso crystal", - [=] { ec->removeParticle(item); }); + [&] { ec->removeParticle(item); }); collapser->addAction(m_removeAction); } } diff --git a/GUI/View/SampleDesigner/ParticleForm.cpp b/GUI/View/SampleDesigner/ParticleForm.cpp index 6ee2f5b143b7b369cc0e594ec0ee5b23eca83c97..d6f06707f40a85846182da5f788f3452dd83c1a6 100644 --- a/GUI/View/SampleDesigner/ParticleForm.cpp +++ b/GUI/View/SampleDesigner/ParticleForm.cpp @@ -43,12 +43,12 @@ ParticleForm::ParticleForm(QWidget* parent, ParticleItem* particleItem, bool all [particleItem](bool b) { particleItem->setExpandParticle(b); }); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "particle", [=] { ec->requestViewInRealspace(particleItem); }); + this, "particle", [&] { ec->requestViewInRealspace(particleItem); }); collapser->addAction(showInRealspaceAction); if (allowRemove) { m_removeAction = ActionFactory::createRemoveAction( - this, "particle", [=] { ec->removeParticle(particleItem); }); + this, "particle", [&] { ec->removeParticle(particleItem); }); collapser->addAction(m_removeAction); } } diff --git a/GUI/View/SampleDesigner/ParticleLayoutForm.cpp b/GUI/View/SampleDesigner/ParticleLayoutForm.cpp index c29ffe72bdebd6b679f850b4255cdff03b514952..5a8979000a208a10ac907b06606f9c4ed24e290e 100644 --- a/GUI/View/SampleDesigner/ParticleLayoutForm.cpp +++ b/GUI/View/SampleDesigner/ParticleLayoutForm.cpp @@ -48,16 +48,16 @@ ParticleLayoutForm::ParticleLayoutForm(LayerForm* parent, ParticleLayoutItem* la auto* btn = LayerEditorUtil::createAddParticleButton( this, - [=](FormFactorItemCatalog::Type type) { ec->addParticleLayoutItem(layoutItem, type); }, - [=](ItemWithParticlesCatalog::Type type) { ec->addParticleLayoutItem(layoutItem, type); }); + [&](FormFactorItemCatalog::Type type) { ec->addParticleLayoutItem(layoutItem, type); }, + [&](ItemWithParticlesCatalog::Type type) { ec->addParticleLayoutItem(layoutItem, type); }); m_structureEditingWidgets << btn; layouter.addStructureEditingRow(btn); m_removeAction = ActionFactory::createRemoveAction( - this, "particle layout", [=] { ec->removeLayoutItem(parent, layoutItem); }); + this, "particle layout", [&] { ec->removeLayoutItem(parent, layoutItem); }); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "particle layout", [=] { ec->requestViewInRealspace(layoutItem); }); + this, "particle layout", [&] { ec->requestViewInRealspace(layoutItem); }); m_collapser = GroupBoxCollapser::installIntoGroupBox(this); m_collapser->setExpanded(layoutItem->isExpandLayout()); diff --git a/GUI/View/SampleDesigner/SampleForm.cpp b/GUI/View/SampleDesigner/SampleForm.cpp index b740bed3f1a05e98dd5e5cd9b1584e7ecd331d57..17ac3cae2d592bf0e04637e2c69fd4b3765618d9 100644 --- a/GUI/View/SampleDesigner/SampleForm.cpp +++ b/GUI/View/SampleDesigner/SampleForm.cpp @@ -45,7 +45,7 @@ public: l->addStretch(); l->addWidget(btn); l->addStretch(); - connect(btn, &QPushButton::clicked, [=]() { ec->addLayerItem(layer); }); + connect(btn, &QPushButton::clicked, [&]() { ec->addLayerItem(layer); }); } LayerItem* m_layer; @@ -84,7 +84,7 @@ SampleForm::SampleForm(QWidget* parent, SampleItem* sampleItem, SampleEditorCont descriptionEdit->setPlainText(sampleItem->description()); layouter.addRow("Description:", descriptionEdit); connect(descriptionEdit, &QTextEdit::textChanged, - [=]() { m_ec->setSampleDescription(descriptionEdit->toPlainText()); }); + [&]() { m_ec->setSampleDescription(descriptionEdit->toPlainText()); }); layouter.addValue(sampleItem->crossCorrLength()); layouter.addVector(sampleItem->externalField(), false); @@ -94,7 +94,7 @@ SampleForm::SampleForm(QWidget* parent, SampleItem* sampleItem, SampleEditorCont [sampleItem](bool b) { sampleItem->setExpandInfo(b); }); auto* showInRealspaceAction = ActionFactory::createShowInRealspaceAction( - this, "sample", [=] { m_ec->requestViewInRealspace(m_sampleItem); }); + this, "sample", [&] { m_ec->requestViewInRealspace(m_sampleItem); }); collapser->addAction(showInRealspaceAction); diff --git a/GUI/View/SampleDesigner/SampleListView.cpp b/GUI/View/SampleDesigner/SampleListView.cpp index 9b97b07bb31a25d0561f18ade179ec11753499e5..a19b8fe2b4fe5328202694ebae9303c7429fa589 100644 --- a/GUI/View/SampleDesigner/SampleListView.cpp +++ b/GUI/View/SampleDesigner/SampleListView.cpp @@ -72,7 +72,7 @@ SampleListView::SampleListView(QWidget* parent, ProjectDocument* document) setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); ItemViewOverlayButtons::install( - this, [=](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); + this, [&](const QModelIndex& i, bool h) { return getOverlayActions(i, h); }); setItemDelegate(new ItemDelegateForSampleTree(this)); connect(selectionModel(), &QItemSelectionModel::currentChanged, this, @@ -123,7 +123,7 @@ SampleListView::SampleListView(QWidget* parent, ProjectDocument* document) auto* action = menu->addAction(icon, title); action->setToolTip(description); connect(action, &QAction::triggered, - [=]() { createSampleFromLibrary(exampleName, title, description); }); + [&]() { createSampleFromLibrary(exampleName, title, description); }); } } @@ -238,7 +238,7 @@ QAction* SampleListView::createRemoveAction(QObject* parent, SampleItem* item) removeAction->setIcon(QIcon(":/images/delete.svg")); removeAction->setIconText("Remove"); removeAction->setToolTip("Remove this sample"); - connect(removeAction, &QAction::triggered, [=]() { removeSample(item); }); + connect(removeAction, &QAction::triggered, [&]() { removeSample(item); }); return removeAction; } diff --git a/GUI/View/Tool/GroupBoxCollapser.cpp b/GUI/View/Tool/GroupBoxCollapser.cpp index c2159d892a1916429427ca3d90de23540f0117a9..010f79fd4dbf6fbe32373f7a816e78a1fb18c8cd 100644 --- a/GUI/View/Tool/GroupBoxCollapser.cpp +++ b/GUI/View/Tool/GroupBoxCollapser.cpp @@ -57,7 +57,7 @@ void GroupBoxCollapser::addAction(QAction* action) m_titleLayout->addWidget(btn); - connect(action, &QAction::changed, [=]() { btn->setVisible(action->isVisible()); }); + connect(action, &QAction::changed, [&]() { btn->setVisible(action->isVisible()); }); } void GroupBoxCollapser::addWidget(QWidget* widget) diff --git a/GUI/View/Toplevel/ProjectsView.cpp b/GUI/View/Toplevel/ProjectsView.cpp index b215c62a6bd43688a0485082155caf47401883ec..fea654f01c8c3d59be3bd329257d8c99e8418adb 100644 --- a/GUI/View/Toplevel/ProjectsView.cpp +++ b/GUI/View/Toplevel/ProjectsView.cpp @@ -36,7 +36,7 @@ ProjectsView::ProjectsView(QWidget* parent) setPalette(palette); connect(m_ui->newButton, &QPushButton::clicked, projectManager(), &ProjectManager::newProject); - connect(m_ui->openButton, &QPushButton::clicked, [=]() { projectManager()->openProject(); }); + connect(m_ui->openButton, &QPushButton::clicked, [&]() { projectManager()->openProject(); }); connect(projectManager(), &ProjectManager::recentListModified, this, &ProjectsView::updateRecentProjectPanel); @@ -57,7 +57,7 @@ void ProjectsView::updateRecentProjectPanel() button->setText(QFileInfo(file).baseName()); button->setDescription(GUI::Util::Path::withTildeHomePath(QDir::toNativeSeparators(file))); button->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); - connect(button, &QCommandLinkButton::clicked, [=] { projectManager()->openProject(file); }); + connect(button, &QCommandLinkButton::clicked, [&] { projectManager()->openProject(file); }); m_ui->recentProjectsLayout->addWidget(button); } diff --git a/GUI/View/Toplevel/SimulationView.cpp b/GUI/View/Toplevel/SimulationView.cpp index 18081698fa71d2430f1b47936a89212ab3474df4..73f1b001f790d8e51324fd523bb43f28b7f54444 100644 --- a/GUI/View/Toplevel/SimulationView.cpp +++ b/GUI/View/Toplevel/SimulationView.cpp @@ -64,9 +64,9 @@ SimulationView::SimulationView(QWidget* parent, ProjectDocument* document) updateFunctionalityNarrowing(); - connect(m_ui->instrumentCombo, &QComboBox::currentTextChanged, [=] { updateStateFromUI(); }); - connect(m_ui->sampleCombo, &QComboBox::currentTextChanged, [=] { updateStateFromUI(); }); - connect(m_ui->realDataCombo, &QComboBox::currentTextChanged, [=] { updateStateFromUI(); }); + connect(m_ui->instrumentCombo, &QComboBox::currentTextChanged, [&] { updateStateFromUI(); }); + connect(m_ui->sampleCombo, &QComboBox::currentTextChanged, [&] { updateStateFromUI(); }); + connect(m_ui->realDataCombo, &QComboBox::currentTextChanged, [&] { updateStateFromUI(); }); connect(m_ui->simulateButton, &QPushButton::clicked, this, &SimulationView::simulate); connect(m_ui->exportToPyScriptButton, &QPushButton::clicked, this, @@ -75,19 +75,19 @@ SimulationView::SimulationView(QWidget* parent, ProjectDocument* document) &SimulationView::updateEnabling); connect(m_ui->runPolicyImmediatelyRadio, &QRadioButton::toggled, - [=]() { updateStateFromUI(); }); + [&]() { updateStateFromUI(); }); - connect(m_ui->analyticalRadio, &QRadioButton::toggled, [=]() { updateStateFromUI(); }); + connect(m_ui->analyticalRadio, &QRadioButton::toggled, [&]() { updateStateFromUI(); }); - connect(m_ui->averageLayerRadio, &QRadioButton::toggled, [=]() { updateStateFromUI(); }); + connect(m_ui->averageLayerRadio, &QRadioButton::toggled, [&]() { updateStateFromUI(); }); connect(m_ui->numberOfThreadsCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), - [=]() { updateStateFromUI(); }); + [&]() { updateStateFromUI(); }); connect(m_ui->numberOfMonteCarloPoints, QOverload<int>::of(&QSpinBox::valueChanged), - [=]() { updateStateFromUI(); }); + [&]() { updateStateFromUI(); }); - connect(m_ui->includeSpecularCheck, &QCheckBox::toggled, [=]() { updateStateFromUI(); }); + connect(m_ui->includeSpecularCheck, &QCheckBox::toggled, [&]() { updateStateFromUI(); }); connect(m_document, &ProjectDocument::modifiedStateChanged, this, &SimulationView::updateFunctionalityNarrowing); diff --git a/GUI/View/Widget/DocksController.cpp b/GUI/View/Widget/DocksController.cpp index fe1da67323d0ba6fce1f344b9a6b21cdd83b3408..3e3c3e3df3a7f154ed5d17ad4f9375200f792758 100644 --- a/GUI/View/Widget/DocksController.cpp +++ b/GUI/View/Widget/DocksController.cpp @@ -67,7 +67,7 @@ QDockWidget* DocksController::addDockForWidget(QWidget* widget) title = stripAccelerator(title); dockWidget->setWindowTitle(title); - connect(dockWidget->toggleViewAction(), &QAction::triggered, [=]() { + connect(dockWidget->toggleViewAction(), &QAction::triggered, [&]() { if (dockWidget->isVisible()) dockWidget->raise(); });