15 #ifndef BORNAGAIN_GUI_MODEL_DESCRIPTOR_DOUBLEPROPERTY_H
16 #define BORNAGAIN_GUI_MODEL_DESCRIPTOR_DOUBLEPROPERTY_H
46 void init(
const QString& label,
const QString& tooltip,
double value,
47 const variant<QString, Unit>& unit,
const QString&
persistentTag);
48 void init(
const QString& label,
const QString& tooltip,
double value,
49 const variant<QString, Unit>& unit,
int decimals,
const RealLimits& limits,
59 operator double()
const {
return m_value; }
86 void setUnit(
const variant<QString, Unit>& unit);
107 #define DOUBLE_PROPERTY(nameLower, nameUpper) \
109 DoubleProperty m_##nameLower; \
112 DoubleDescriptor nameLower() const { return m_##nameLower; } \
113 void set##nameUpper(double v) { m_##nameLower.set(v); }
Defines class DoubleDescriptor.
Describes properties of a double value which are necessary to allow GUI representation,...
Class for representing a double value, its attributes and its accessors.
void setTooltip(const QString &tooltip)
Set the tooltip.
void setLimits(const RealLimits &limits)
Set the limits.
DoubleDescriptor m_descriptor
descriptor, holding more attributes like label, tooltip etc.
QString m_uid
Unique id of this double property.
QString uid() const
Unique id of this double property.
QString persistentTag() const
Persistent tag for serializing.
unsigned m_decimals
Number of decimals to be shown in an edit field.
void setDecimals(unsigned decimals)
Set number of decimals to be shown in an edit field.
double m_value
Current value.
void setUnit(const variant< QString, Unit > &unit)
Set the unit.
unsigned decimals() const
Number of decimals to be shown in an edit field.
void set(double d)
Set the contained value.
DoubleDescriptor descriptor() const
Return a descriptor (information provider) for this double property.
double get() const
The contained value.
QString m_persistentTag
Persistent tag for serializing.
void init(const QString &label, const QString &tooltip, double value, const variant< QString, Unit > &unit, const QString &persistentTag)
bool isInitialized() const
True if one of the init methods has been called (checks for a valid uid).
void setUid(const QString &uid)
Set the unique id of this double property.
Supports serialization to or deserialization from QXmlStream.
Functions to serialize various data types.
void rwProperty(Streamer &s, DoubleProperty &d)