Commit 9d8b6f8a authored by SZPYRKA Jean-Luc's avatar SZPYRKA Jean-Luc

changed stepUp/Down for scientific option

parent d2a18040
......@@ -72,5 +72,42 @@ 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);
}
void dtkDoubleSpinBox::stepBy(int step)
{
if (step == 0 ) {
return;
}
if (step < 0) {
int i = step;
while ( i < 0 ) {
stepDown();
i++;
}
}
else {
int i = step;
while ( i > 0) {
stepUp();
i--;
}
}
}
void dtkDoubleSpinBox::stepDown(void)
{
if (d->scientific)
setValue(value()/10.0);
else
setValue(value()-1.0);
}
void dtkDoubleSpinBox::stepUp(void)
{
if (d->scientific)
setValue(value()*10.0);
else
setValue(value()+1.0);
}
//
// dtkDoubleSpinBox.h ends here
......@@ -38,6 +38,11 @@ public:
QValidator::State validate(QString&, int&) const;
void stepBy(int);
void stepDown(void);
void stepUp(void);
private:
class dtkDoubleSpinBoxPrivate *d;
};
......
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