00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <qlineedit.h>
00019 #include "doublespinbox.h"
00020
00021
00022 DoubleSpinBox::DoubleSpinBox(QWidget *parent, const char *name) :
00023 QSpinBox(parent,name)
00024 {
00025 editor()->setAlignment(Qt::AlignRight);
00026 }
00027
00028 DoubleSpinBox::DoubleSpinBox(int minValue, int maxValue, int step, QWidget *parent, const char *name) :
00029 QSpinBox(minValue,maxValue,step,parent,name)
00030 {
00031 editor()->setAlignment(Qt::AlignRight);
00032 }
00033
00034 QString DoubleSpinBox::mapValueToText(int value) {
00035 return QString("%1.%2").arg(value/10).arg(value%10);
00036 }
00037
00038 int DoubleSpinBox::mapTextToValue(bool *ok) {
00039 bool foo; foo=ok;
00040 return int(text().toFloat()*10);
00041 }
00042
00043