From 024e81bf9faf67dd31307d33eaccfa5e6500cb6c Mon Sep 17 00:00:00 2001 From: akl Date: Thu, 20 Mar 2008 14:26:50 +0000 Subject: [PATCH] + void initSpinBox( QSpinBox*, int, int, int = 1 ) + void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 ) --- src/VISUGUI/VisuGUI_Tools.cxx | 18 ++++++++++++++++++ src/VISUGUI/VisuGUI_Tools.h | 4 ++++ 2 files changed, 22 insertions(+) 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 -- 2.39.2