diff --git a/GUI/Model/Model/ParameterTreeUtils.cpp b/GUI/Model/Model/ParameterTreeUtils.cpp index bb3913bb7ea4ddd6eb4310047f1cf71d866d9c41..45a3689bcd1d01d2d240fbcb56efb1c6e08747d5 100644 --- a/GUI/Model/Model/ParameterTreeUtils.cpp +++ b/GUI/Model/Model/ParameterTreeUtils.cpp @@ -228,8 +228,7 @@ void ParameterTreeBuilder::addInterference(ParameterLabelItem* layoutLabel, auto* dfLabel = addLabel<Profile2DItemCatalog>(label, "Decay function", df); for (const auto& d : df->valueDescriptors()) addParameterItem(dfLabel, d); - } else if (auto* itf = - dynamic_cast<InterferenceFinite2DLatticeItem*>(interference)) { + } else if (auto* itf = dynamic_cast<InterferenceFinite2DLatticeItem*>(interference)) { // domainSize1 and domainSize2 are of type UInt (not matching the double approach for tuning // and fitting). In BornAgain 1.18 these values have not been added to the tuning tree, and // also not to the fitting parameters. Maybe this should be necessary, but for now this diff --git a/GUI/Model/Model/ParameterTreeUtils.h b/GUI/Model/Model/ParameterTreeUtils.h index 1cb2db931d69db1331698e8db1b40b9832f11130..3ee62be724d001987cfade017a5cbce017395d3e 100644 --- a/GUI/Model/Model/ParameterTreeUtils.h +++ b/GUI/Model/Model/ParameterTreeUtils.h @@ -54,7 +54,7 @@ private: void addInstrument(); void addParameterItem(ParameterLabelItem* parent, DoubleProperty& d, const QString& label = QString()); - void addParameterItem(ParameterLabelItem* parent, VectorProperty &d); + void addParameterItem(ParameterLabelItem* parent, VectorProperty& d); ParameterContainerItem* parameterContainer(); bool allowMagneticFields() const; @@ -72,7 +72,7 @@ private: void addDetector(ParameterLabelItem* parentLabel, DetectorItem* detector); void addBackground(ParameterLabelItem* instrumentLabel, BackgroundItem* backgroundItem); - void addPolarization(ParameterLabelItem* instrumentLabel, InstrumentItem *instrument); + void addPolarization(ParameterLabelItem* instrumentLabel, InstrumentItem* instrument); private: JobItem* m_jobItem; diff --git a/GUI/View/SampleDesigner/FormLayouter.cpp b/GUI/View/SampleDesigner/FormLayouter.cpp index 2e43a3223cf28f86d1dad0c0bc525d2f21f78c4a..790a3ddbd27ae79686fef5e40ee0609d41f95e47 100644 --- a/GUI/View/SampleDesigner/FormLayouter.cpp +++ b/GUI/View/SampleDesigner/FormLayouter.cpp @@ -129,13 +129,13 @@ void FormLayouter::addStructureEditingRow(QPushButton* button) addRow(w); } -int FormLayouter::addValue(DoubleProperty &d) +int FormLayouter::addValue(DoubleProperty& d) { insertValue(m_formLayout->rowCount(), d); return m_formLayout->rowCount() - 1; } -int FormLayouter::addValue(DoubleProperty &d, function<void(double)> onValueChange) +int FormLayouter::addValue(DoubleProperty& d, function<void(double)> onValueChange) { insertValue(m_formLayout->rowCount(), d, onValueChange); return m_formLayout->rowCount() - 1; @@ -147,8 +147,7 @@ void FormLayouter::insertValue(int row, DoubleProperty& d) insertValue(row, d, [ec, d](double newValue) { ec->setDouble(newValue, d); }); } -void FormLayouter::insertValue(int row, DoubleProperty &d, - function<void(double)> onValueChange) +void FormLayouter::insertValue(int row, DoubleProperty& d, function<void(double)> onValueChange) { auto labelText = d.label(); if (!labelText.endsWith(":")) diff --git a/GUI/View/SampleDesigner/FormLayouter.h b/GUI/View/SampleDesigner/FormLayouter.h index dfcc83fbacf9e234f8213ec64e17ee5f11afb59c..2d19425d1222915bd54a63dd63bba6eac82cb305 100644 --- a/GUI/View/SampleDesigner/FormLayouter.h +++ b/GUI/View/SampleDesigner/FormLayouter.h @@ -28,9 +28,9 @@ class VectorProperty; //! Utility class to populate a QFormLayout. //! -//! Helps to add edit controls which operate on Properties (DoubleProperty, VectorProperty, SelectionProperty). -//! Also takes care of bold printed labels, the connection of labels and edit controls -//! (buddies), which is necessary to realize the "label shows unit of value" feature. +//! Helps to add edit controls which operate on Properties (DoubleProperty, VectorProperty, +//! SelectionProperty). Also takes care of bold printed labels, the connection of labels and edit +//! controls (buddies), which is necessary to realize the "label shows unit of value" feature. //! Connections to a given SampleEditorController are established as well. class FormLayouter { public: @@ -108,7 +108,7 @@ public: //! Inserts a row with a bold printed label and a DoubleSpinBox. //! //! Same functionality as addValue(), please read there. - void insertValue(int row, DoubleProperty &d); + void insertValue(int row, DoubleProperty& d); //! Inserts a row with a bold printed label and a DoubleSpinBox. //! @@ -117,8 +117,8 @@ public: //! Adds a row with a bold printed label and a set of DoubleDescriptors. //! - //! The label describes the set of the DoubleProperties and is located in the first column of the - //! layout. The DoubleSpinBoxes for each DoubleProperty are created as children of a newly + //! The label describes the set of the DoubleProperties and is located in the first column of + //! the layout. The DoubleSpinBoxes for each DoubleProperty are created as children of a newly //! created widget, which is positioned in the second column of the layout. If the number of //! values is greater than 1, the related labels are shown above them, to limit the necessary //! space to the right. For the creation, signaling, unit handling etc. of one DoubleProperty @@ -132,7 +132,7 @@ public: //! In addition, the caller can define whether the labels are above the values //! (vertically=true), or whether labels and values are all placed in one row //! (vertically=false). - int addVector(VectorProperty &d, bool vertically = true); + int addVector(VectorProperty& d, bool vertically = true); //! Shows or hides the widgets in a row. void setRowVisible(int row, bool visible); diff --git a/GUI/View/SampleDesigner/LayerEditorUtils.cpp b/GUI/View/SampleDesigner/LayerEditorUtils.cpp index b99cdaa2c711dcee2185a6070efab889b0777d2f..a09dbc19dc9a144121bde4d4b7559b5e6dbb1aea 100644 --- a/GUI/View/SampleDesigner/LayerEditorUtils.cpp +++ b/GUI/View/SampleDesigner/LayerEditorUtils.cpp @@ -121,17 +121,15 @@ void LayerEditorUtils::addMultiPropertyToGrid(QGridLayout* m_gridLayout, int fir valueDescriptors.size() > 1, addSpacer); } -void LayerEditorUtils::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, - VectorProperty &v, SampleEditorController* ec, - bool vertically, bool addSpacer) +void LayerEditorUtils::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, + SampleEditorController* ec, bool vertically, bool addSpacer) { addMultiPropertyToGrid(m_gridLayout, firstCol, {v.x(), v.y(), v.z()}, ec, vertically, addSpacer); } -void LayerEditorUtils::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, - VectorProperty& v, +void LayerEditorUtils::addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, function<void(double, DoubleDescriptor)> setNewValue, bool vertically, bool addSpacer) { diff --git a/GUI/View/SampleDesigner/LayerEditorUtils.h b/GUI/View/SampleDesigner/LayerEditorUtils.h index 59655d11e451c65419f0a37bdc273cdc34db01c0..383a9b24754fd1d6d93a1dbb30aac68a11d00352 100644 --- a/GUI/View/SampleDesigner/LayerEditorUtils.h +++ b/GUI/View/SampleDesigner/LayerEditorUtils.h @@ -65,7 +65,7 @@ void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, SampleEditorController* ec, bool vertically, bool addSpacer); //! Create DoubleSpinBoxes for the DoubeDescriptors and connect them to the given setNewValue() -void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty &v, +void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, VectorProperty& v, std::function<void(double, DoubleDescriptor)> setNewValue, bool vertically, bool addSpacer);