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
29 class QTX_EXPORT QtxDblSpinBox : public QSpinBox
36 typedef enum QSpinBox::ButtonSymbols ButtonSymbols;
39 QtxDblSpinBox( QWidget* = 0, const char* = 0 );
40 QtxDblSpinBox( double, double, double = 1, QWidget* = 0, const char* = 0 );
41 virtual ~QtxDblSpinBox();
43 double minValue() const;
44 double maxValue() const;
45 void setMinValue( int );
46 void setMaxValue( int );
47 void setMinValue( double );
48 void setMaxValue( double );
49 void setRange( int, int );
50 virtual void setRange( double, double );
52 double lineStep() const;
53 void setLineStep( int );
54 virtual void setLineStep( double );
58 int precision() const;
59 virtual void setPrecision( const int );
61 bool isCleared() const;
62 virtual void setCleared( const bool );
64 virtual bool eventFilter( QObject*, QEvent* );
67 void valueChanged( double );
68 void valueChanged( const QString& );
71 virtual void stepUp();
72 virtual void stepDown();
73 virtual void selectAll();
74 virtual void setValue( int );
75 virtual void setValue( double );
78 virtual void onTextChanged( const QString& );
81 virtual void updateDisplay();
82 virtual void interpretText();
84 virtual void valueChange();
85 virtual void rangeChange();
87 QString currentValueText();
88 virtual QString mapValueToText( int );
89 virtual QString mapValueToText( double );
90 virtual double mapTextToDoubleValue( bool* );
92 virtual void leaveEvent( QEvent* );
93 virtual void wheelEvent( QWheelEvent* );
95 double bound( double );
97 QString removeTrailingZeroes( const QString& ) const;