16 #include "Base/Util/Assert.h"
31 #include <QGridLayout>
33 #include <QPushButton>
42 m_layout->setContentsMargins(0, 0, 0, 0);
56 for (
auto* editor : findChildren<DoubleSpinBox*>()) {
57 QSignalBlocker b(editor);
58 editor->setBaseValue(editor->valueDescriptor());
60 for (
auto* editor : findChildren<DoubleLineEdit*>()) {
61 QSignalBlocker b(editor);
62 editor->setBaseValue(editor->valueDescriptor());
97 if (material->hasRefractiveIndex())
98 values << material->delta() << material->beta();
100 values << material->sldRe() << material->sldIm();
103 for (
const auto& d : values) {
105 auto* label =
new QLabel(d.label,
this);
106 label->setBuddy(editor);
112 m_layout->addWidget(editor, 1, col++);
123 auto* btn =
new QPushButton(
"...",
this);
124 btn->setToolTip(
"Select material");
128 m_layout->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding), 0,
m_layout->columnCount());
Defines GUI::Util namespace.
Defines class DoubleDescriptor.
QList< DoubleDescriptor > DoubleDescriptors
Defines class DoubleLineEdit.
Defines class DoubleSpinBox.
Defines abstract item with a material property.
Defines class LayerEditorUtils.
Defines namespace GUI::Util::Layout.
Defines class MaterialEditorDialog.
Defines class MaterialItem.
Defines class MaterialItems.
Defines class MultiLayerItem.
Defines class SampleEditorController.
Defines class VectorDescriptor.
Describes properties of a double value which are necessary to allow GUI representation,...
LineEdit to edit values in a scientific notation, operating on a DoubleDescriptor.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
QString materialIdentifier() const
MaterialItem * materialItem() const
Returns the material item this item links to.
static QString chooseMaterial(QWidget *parent, MultiLayerItem *sample, const QString &identifierOfPreviousMaterial)
Use this to choose a material. identifierOfPreviousMaterial is the material which should be selected ...
MaterialItems & materialItems()
Class to modify a sample from the layer oriented sample editor.
MultiLayerItem * sampleItem() const
The item on which this controller operates.
void selectMaterial(ItemWithMaterial *item, const QString &newMaterialIdentifier)
void setMaterialValue(ItemWithMaterial *item, double newValue, DoubleDescriptor d)
Describes properties of a 3D vector, consisting of three double values.
static QMainWindow * mainWindow
void clearLayout(QLayout *layout, bool deleteWidgets=true)
Removes content from box layout.
QByteArray createBackup(const T *t)
void addVectorToGrid(QGridLayout *m_gridLayout, int firstCol, const VectorDescriptor &v, SampleEditorController *ec, bool vertically, bool addSpacer)
Create DoubleSpinBoxes for the DoubeDescriptors and connect them to SampleEditorController::setDouble...