diff --git a/GUI/Model/Descriptor/DoubleProperty.cpp b/GUI/Model/Descriptor/DoubleProperty.cpp index 72a5c6bc50b9e97c989c18f06162b88b1f78f093..af9071e51b17ab71af878a37e24148ca62d053dc 100644 --- a/GUI/Model/Descriptor/DoubleProperty.cpp +++ b/GUI/Model/Descriptor/DoubleProperty.cpp @@ -36,7 +36,6 @@ void DoubleProperty::init(const QString& label, const QString& tooltip, double v m_label = label; m_tooltip = tooltip; m_value = value; - m_unit = Unit::unitless; m_decimals = decimals; m_step = step; m_limits = limits; @@ -52,11 +51,6 @@ void DoubleProperty::setTooltip(const QString& tooltip) m_tooltip = tooltip; } -void DoubleProperty::setUnit(const variant<QString, Unit>& unit) -{ - m_unit = unit; -} - void DoubleProperty::setLimits(const RealLimits& limits) { m_limits = limits; diff --git a/GUI/Model/Descriptor/DoubleProperty.h b/GUI/Model/Descriptor/DoubleProperty.h index 684ca42eaee1311daddfe64013b29c7f59a18e2a..07f84d2ae20d97412aada8a4eb9a4962e23648b8 100644 --- a/GUI/Model/Descriptor/DoubleProperty.h +++ b/GUI/Model/Descriptor/DoubleProperty.h @@ -28,9 +28,6 @@ //! * the value itself //! * label: a label of e.g. a spin box //! * tooltip: tooltip for e.g. a spin box -//! * unit: unit of this value (not the representation on UI, but the unit of the contained value). -//! Use this to show the unit in the UI as well as allow a representation in a different unit -//! (e.g. Angstrom instead of nanometer) //! * decimals: how many decimals shall be shown in a spin box //! * limits: which limits shall be set in a spin box or other validator //! * uid: a unique id which represents this property. This is used for linking to this property, @@ -65,7 +62,6 @@ public: void setTooltip(const QString& tooltip); std::variant<QString, Unit> unit() const { return m_unit; } - void setUnit(const std::variant<QString, Unit>& unit); RealLimits limits() const { return m_limits; } void setLimits(const RealLimits& limits); @@ -88,7 +84,7 @@ private: uint m_decimals = 3; //!< numbers of decimals to be shown in an edit control double m_step = 0.01; //!< numbers of decimals to be shown in an edit control RealLimits m_limits; //!< Limits of the value. - std::variant<QString, Unit> m_unit = + static constexpr std::variant<QString, Unit> m_unit = Unit::unitless; //!< Unit of the value (internal unit only!) };