From: akl Date: Thu, 20 Mar 2008 14:26:50 +0000 (+0000) Subject: + void initSpinBox( QSpinBox*, int, int, int = 1 ) X-Git-Tag: V5_0_0a1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=024e81bf9faf67dd31307d33eaccfa5e6500cb6c;p=modules%2Fvisu.git + void initSpinBox( QSpinBox*, int, int, int = 1 ) + void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 ) --- diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index b9cfdb00..0519fb25 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -76,6 +76,8 @@ #include #include +#include +#include //============================================================================= @@ -1345,4 +1347,20 @@ namespace VISU } } //------------------------------------------------------------ + void initSpinBox( QSpinBox* spinBox, + int min, int max, int step ) + { + spinBox->setRange( min, max ); + spinBox->setSingleStep( step ); + } + //------------------------------------------------------------ + void initSpinBox( QDoubleSpinBox* spinBox, + double min, double max, + double step, int decimals ) + { + spinBox->setRange( min, max ); + spinBox->setSingleStep( step ); + spinBox->setDecimals( decimals ); + } + //------------------------------------------------------------ } diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index aa795d80..8e69af3d 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -40,6 +40,8 @@ class QWidget; class QDialog; +class QSpinBox; +class QDoubleSpinBox; class SUIT_Desktop; class SUIT_ViewWindow; @@ -223,6 +225,8 @@ namespace VISU VISU::Prs3d_i* thePrs3d, int pos); void RemoveScalarBarPosition(VisuGUI* theModule, SVTK_ViewWindow* theViewWindow, VISU::Prs3d_i* thePrs3d); + void initSpinBox( QSpinBox*, int, int, int = 1 ); + void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 ); } #endif