Salome HOME
yfr : Merge V1.2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SpinBox.cxx
1 using namespace std;
2 //  File      : SMESHGUI_SpinBox.cxx
3 //  Created   : 14 august 2002
4 //  Author    : Lucien PIGNOLONI
5 //  Project   : SALOME
6 //  Module    : SMESHGUI
7 //  Copyright : OPEN CASCADE
8 //  $Header$
9
10 #include "SMESHGUI_SpinBox.h"
11 #include "SMESHGUI.h"
12 #include <qvalidator.h>
13
14 //=================================================================================
15 // class    : SMESHGUI_SpinBox()
16 // purpose  : constructor of specific widget accepting floats in double precision.
17 //=================================================================================
18 SMESHGUI_SpinBox::SMESHGUI_SpinBox( QWidget* parent, const char* name )
19 : QAD_SpinBoxDbl( parent, name)
20 {
21 }
22
23
24 //=================================================================================
25 // function : SetStep()  [SLOT]
26 // purpose  :
27 //=================================================================================
28 void SMESHGUI_SpinBox::SetStep( double newStep )
29 {
30   setLineStep( newStep );
31 }
32
33 //=================================================================================
34 // function : ~SMESHGUI_SpinBox()
35 // purpose  : destructor
36 //=================================================================================
37 SMESHGUI_SpinBox::~SMESHGUI_SpinBox()
38 {
39 }
40
41 //=================================================================================
42 // function : SetValue()
43 // purpose  :
44 //=================================================================================
45 void SMESHGUI_SpinBox::SetValue( double v )
46 {
47   setValue( v );
48 }
49
50 //=================================================================================
51 // function : GetValue()
52 // purpose  : returns a double
53 //=================================================================================
54 double SMESHGUI_SpinBox::GetValue( )
55 {
56   return value();
57 }
58
59 //=================================================================================
60 // function : GetString()
61 // purpose  : returns a QString
62 //=================================================================================
63 QString SMESHGUI_SpinBox::GetString( )
64 {
65   return cleanText();
66 }
67
68 //=================================================================================
69 // function : RangeStepAndValidator()
70 // purpose  :
71 //=================================================================================
72 void SMESHGUI_SpinBox::RangeStepAndValidator( double min, double max, double step, unsigned short decimals )
73 {
74   setRange( min, max );
75   setLineStep( step );
76   ( ( QDoubleValidator* )validator() )->setRange( min, max, decimals ) ;
77 }