From 0d9c3765cfd92760bfb6de66087bac9246970ce0 Mon Sep 17 00:00:00 2001 From: dmv Date: Wed, 29 Oct 2008 13:01:26 +0000 Subject: [PATCH] Qt4 porting: it's impossible to validate Scale Factor = 0 set by typing --- src/VISUGUI/VisuGUI_CutPlanesDlg.cxx | 14 +++++++------- .../VisuGUI_DeformedShapeAndScalarMapDlg.cxx | 14 +++++++------- src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx | 14 +++++++------- src/VISUGUI/VisuGUI_VectorsDlg.cxx | 14 +++++++------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 879691f5..7cdb29cb 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -188,7 +188,7 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent) QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation); GDeformationLayout->addWidget( LabelDeformation2, 1, 0 ); - myScaleSpn = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation); + myScaleSpn = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation); myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); GDeformationLayout->addWidget( myScaleSpn, 1, 1 ); connect(myVectorialFieldCombo, SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int))); @@ -312,17 +312,17 @@ double VisuGUI_CutPlanesPane::getScaleFactor(){ void VisuGUI_CutPlanesPane::setScaleFactor(double theFactor){ double i=0.1; - while (1) { // Calculate Step & Precission - if ( int (theFactor/i) >= 0) - break; - else { - i = i*0.1; + if (theFactor > 0) { + while (1) { // Calculate Step & Precission + if ( int (theFactor/i) >= 0) + break; + else + i = i*0.1; } } myScaleSpn->setSingleStep(i); myScaleSpn->setValue(theFactor); - } void VisuGUI_CutPlanesPane::createPlanes() diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx index c48a8d03..69ff6259 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx @@ -100,7 +100,7 @@ VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (Salo SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScalFact = new QtxDoubleSpinBox (1.0E-20, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup); + ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup); ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); ScalFact->setValue(0.1); TopGroupLayout->addWidget(ScalFact, 0, 1); @@ -295,16 +295,16 @@ double VisuGUI_DeformedShapeAndScalarMapDlg::getFactor() const void VisuGUI_DeformedShapeAndScalarMapDlg::setFactor(double theFactor) { double i=0.1; - while (1) { // Calculate Step & Precission - if ( int (theFactor/i) > 0) - break; - else { - i = i*0.1; + if ( theFactor > 0 ) { + while (1) { // Calculate Step & Precission + if ( int (theFactor/i) > 0) + break; + else + i = i*0.1; } } ScalFact->setSingleStep(i); - ScalFact->setValue(theFactor); } diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index a6129feb..9f4de1b4 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -92,7 +92,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScalFact = new QtxDoubleSpinBox (1.0E-20, 1.0E+38, 0.1, aPrecision*(-1), 38, TopGroup); + ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, TopGroup); ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); ScalFact->setValue(0.1); TopGroupLayout->addWidget(ScalFact, 0, 1); @@ -173,16 +173,16 @@ void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs, void VisuGUI_DeformedShapeDlg::setFactor(double theFactor) { double i=0.1; - while (1) { // Calculate Step & Precission - if ( int (theFactor/i) > 0) - break; - else { - i = i*0.1; + if (theFactor > 0) { + while (1) { // Calculate Step & Precission + if ( int (theFactor/i) > 0) + break; + else + i = i*0.1; } } ScalFact->setSingleStep(i); - ScalFact->setValue(theFactor); } diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index 91e037a6..10b210c9 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -93,7 +93,7 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 ); - ScalFact = new QtxDoubleSpinBox( 1e-20, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup ); + ScalFact = new QtxDoubleSpinBox( 0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup ); ScalFact->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); ScalFact->setValue( 0.1 ); @@ -327,16 +327,16 @@ void VisuGUI_VectorsDlg::enableSetColor() void VisuGUI_VectorsDlg::setScaleFactor( double theFactor ) { double i=0.1; - while (1) { // Calculate Step & Precission - if ( int (theFactor/i) > 0) - break; - else { - i = i*0.1; + if (theFactor > 0) { // Calculate Step & Precission + while (1) { + if ( int (theFactor/i) > 0) + break; + else + i = i*0.1; } } ScalFact->setSingleStep(i); - ScalFact->setValue( theFactor ); } -- 2.39.2