1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 // File: QtxDblSpinBox.h
20 // Author: Sergey TELKOV
22 #ifndef QTXDBLSPINBOX_H
23 #define QTXDBLSPINBOX_H
31 Spin box for real numbers.
33 class QTX_EXPORT QtxDblSpinBox : public QSpinBox
40 typedef enum QSpinBox::ButtonSymbols ButtonSymbols;
43 QtxDblSpinBox( QWidget* = 0, const char* = 0 );
44 QtxDblSpinBox( double, double, double = 1, QWidget* = 0, const char* = 0 );
45 virtual ~QtxDblSpinBox();
47 double minValue() const;
48 double maxValue() const;
49 void setMinValue( int );
50 void setMaxValue( int );
51 void setMinValue( double );
52 void setMaxValue( double );
53 void setRange( int, int );
54 virtual void setRange( double, double );
56 double lineStep() const;
57 void setLineStep( int );
58 virtual void setLineStep( double );
62 int precision() const;
63 virtual void setPrecision( const int );
65 bool isCleared() const;
66 virtual void setCleared( const bool );
68 virtual bool eventFilter( QObject*, QEvent* );
71 void valueChanged( double );
72 void valueChanged( const QString& );
75 virtual void stepUp();
76 virtual void stepDown();
77 virtual void selectAll();
78 virtual void setValue( int );
79 virtual void setValue( double );
82 virtual void onTextChanged( const QString& );
85 virtual void updateDisplay();
86 virtual void interpretText();
88 virtual void valueChange();
89 virtual void rangeChange();
91 QString currentValueText();
92 virtual QString mapValueToText( int );
93 virtual QString mapValueToText( double );
94 virtual double mapTextToDoubleValue( bool* );
96 virtual void leaveEvent( QEvent* );
97 virtual void wheelEvent( QWheelEvent* );
99 double bound( double );
101 QString removeTrailingZeroes( const QString& ) const;