16 #include <QDoubleValidator>
20 , m_valueDescriptor(d)
22 m_validator =
new QDoubleValidator(0.0, 1e+200, 1000,
this);
23 m_validator->setNotation(QDoubleValidator::ScientificNotation);
24 const double minimum =
25 d.
limits.hasLowerLimit() ? std::max(d.
limits.lowerLimit(), -1e+200) : -1e+200;
26 const double maximum =
27 d.
limits.hasUpperLimit() ? std::min(d.
limits.upperLimit(), +1e+200) : +1e+200;
38 setText(QString::number(baseValue,
'g'));
48 const double new_value = text().toDouble();
Defines class DoubleLineEdit.
Describes properties of a double value which are necessary to allow GUI representation,...
RealLimits limits
Limits of the value.
function< double()> get
function to get the current value
const DoubleDescriptor & valueDescriptor() const
The descriptor on which this line edit operates.
void baseValueChanged(double newBaseValue)
Emitted whenever the value changes.
DoubleLineEdit(QWidget *parent, const DoubleDescriptor &d)
void setBaseValue(double baseValue)
Set the base value (unit is the one of the contained descriptor).
QDoubleValidator * m_validator
DoubleDescriptor m_valueDescriptor