2 // File : GeometryGUI_SpinBox.cxx
3 // Created : 5 june 2002
4 // Author : Lucien PIGNOLONI
6 // Module : GeometryGUI
7 // Copyright : OPEN CASCADE
10 #include "GeometryGUI_SpinBox.h"
11 #include "GeometryGUI.h"
12 #include <qvalidator.h>
13 //#include <qpushbutton.h>
14 //#include "utilities.h"
16 //=================================================================================
17 // class : GeometryGUI_SpinBox()
18 // purpose : constructor of specific widget accepting floats in double precision.
19 //=================================================================================
20 GeometryGUI_SpinBox::GeometryGUI_SpinBox( QWidget* parent, const char* name )
21 : QAD_SpinBoxDbl( parent, name)
23 /* when step value is changed in myGeomGUI */
24 connect( GeometryGUI::GetGeometryGUI(), SIGNAL( SignalDefaultStepValueChanged( double )), this, SLOT( SetStep( double ) ) );
28 //=================================================================================
29 // function : SetStep() [SLOT]
31 //=================================================================================
32 void GeometryGUI_SpinBox::SetStep( double newStep )
34 setLineStep( newStep );
37 //=================================================================================
38 // function : ~GeometryGUI_SpinBox()
39 // purpose : destructor
40 //=================================================================================
41 GeometryGUI_SpinBox::~GeometryGUI_SpinBox()
45 //=================================================================================
46 // function : SetValue()
48 //=================================================================================
49 void GeometryGUI_SpinBox::SetValue( double v )
54 //=================================================================================
55 // function : GetValue()
56 // purpose : returns a double
57 //=================================================================================
58 double GeometryGUI_SpinBox::GetValue( )
63 //=================================================================================
64 // function : GetString()
65 // purpose : returns a QString
66 //=================================================================================
67 QString GeometryGUI_SpinBox::GetString( )
72 //=================================================================================
73 // function : RangeStepAndValidator()
75 //=================================================================================
76 void GeometryGUI_SpinBox::RangeStepAndValidator( double min, double max, double step, unsigned short decimals )
80 ( ( QDoubleValidator* )validator() )->setRange( min, max, decimals ) ;