Commit d2a18040 authored by SZPYRKA Jean-Luc's avatar SZPYRKA Jean-Luc

fixed desctructor()

parent 2785ce5e
......@@ -33,11 +33,13 @@ dtkDoubleSpinBox::dtkDoubleSpinBox(QDoubleValidator::Notation notation, QWidget
this->setMaximum(std::numeric_limits<double>::max()); // instead of default 99.99
this->setMaximum(std::numeric_limits<double>::lowest());
this->setDecimals(12);
this->setDecimals(32);
}
dtkDoubleSpinBox::~dtkDoubleSpinBox(void)
{
delete d->validator;
delete d;
}
QString dtkDoubleSpinBox::textFromValue ( double value ) const
......@@ -55,17 +57,9 @@ QString dtkDoubleSpinBox::textFromValue ( double value ) const
double dtkDoubleSpinBox::valueFromText ( const QString & text ) const
{
bool ok;
double dblValue = text.toDouble(&ok);
QString strValue;
if (d->scientific)
strValue = QString::number(dblValue, 'e', this->decimals());
else
strValue = QString::number(dblValue, 'f', this->decimals());
//qDebug() << Q_FUNC_INFO << "text =" << text << "value =" << strValue << "ok=" << ok;
double dblValue = text.toDouble();
//qDebug() << Q_FUNC_INFO << "text =" << text << "value =" << dblValue;
return dblValue;
}
......@@ -78,6 +72,5 @@ QValidator::State dtkDoubleSpinBox::validate(QString &text, int &pos) const
//qDebug() << Q_FUNC_INFO << "text =" << text << "pos =" << pos << "validate =" << input_check;
return (input_check ? QValidator::Acceptable : QValidator::Invalid);
}
//
// dtkDoubleSpinBox.h ends here
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment