18 #include <QVBoxLayout>
26 setAutoFillBackground(
true);
27 setFocusPolicy(Qt::StrongFocus);
31 auto layout =
new QVBoxLayout;
33 layout->setSpacing(0);
75 if (
m_data.type() != QVariant::Double)
76 throw std::runtime_error(
77 "ScientificSpinBoxEditor::update_components() -> Error. Wrong variant type");
Base class for all custom variant editors.
void setDataIntern(const QVariant &data)
Saves the data as given by editor's internal components and notifies the model.
void setDecimals(int decimals)
void setRange(double minimum, double maximum)
void setSingleStep(double step)
bool is_persistent() const override
Returns true if editor should remains alive after editing finished.
ScientificSpinBoxEditor(QWidget *parent=nullptr)
void update_components() override
Should update widget components from m_data, if necessary.
ScientificSpinBox * m_doubleEditor
void setMaximum(double max)
void setMinimum(double min)
void setValue(double val)
void setSingleStep(double step)
void valueChanged(double value)
MVVM_MODEL_EXPORT bool AreAlmostEqual(double a, double b, double tolerance_factor=1.0)
Returns true if two doubles agree within epsilon*tolerance.
materialitems.h Collection of materials to populate MaterialModel.