From 872de320768af9e8934911eb053efa5ef8554a1a Mon Sep 17 00:00:00 2001 From: dmv Date: Thu, 9 Oct 2008 11:42:25 +0000 Subject: [PATCH] Qt4 porting. There are nonsignificant zeros in fields of some dialog boxes, if a DoubleSpin box is used. --- src/BasicGUI/BasicGUI_MarkerDlg.cxx | 18 ++++---- src/BasicGUI/BasicGUI_MarkerDlg.h | 4 +- src/BlocksGUI/BlocksGUI_TrsfDlg.cxx | 6 +-- src/BlocksGUI/BlocksGUI_TrsfDlg.h | 4 +- src/EntityGUI/EntityGUI_SketcherDlg.cxx | 3 +- src/OperationGUI/OperationGUI_ChamferDlg.cxx | 13 +++--- src/OperationGUI/OperationGUI_ChamferDlg.h | 5 +-- src/OperationGUI/OperationGUI_ClippingDlg.cxx | 9 ++-- src/OperationGUI/OperationGUI_ClippingDlg.h | 6 +-- src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx | 4 +- src/RepairGUI/RepairGUI_DivideEdgeDlg.h | 4 +- src/RepairGUI/RepairGUI_GlueDlg.cxx | 6 +-- src/RepairGUI/RepairGUI_GlueDlg.h | 6 +-- src/RepairGUI/RepairGUI_SewingDlg.cxx | 6 +-- src/RepairGUI/RepairGUI_SewingDlg.h | 4 +- src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx | 42 +++++++------------ src/RepairGUI/RepairGUI_ShapeProcessDlg.h | 24 +++++------ 17 files changed, 76 insertions(+), 88 deletions(-) diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index e7cdef29a..4bc68d0c8 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -99,13 +99,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th QVBoxLayout* anOriGrpLayout = new QVBoxLayout( anOriGrp ); anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), anOriGrp ) ); - myData[ X ] = new QDoubleSpinBox( anOriGrp ); + myData[ X ] = new QtxDoubleSpinBox( anOriGrp ); anOriGrpLayout->addWidget( myData[ X ] ); anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Y" ), anOriGrp ) ); - myData[ Y ] = new QDoubleSpinBox( anOriGrp ); + myData[ Y ] = new QtxDoubleSpinBox( anOriGrp ); anOriGrpLayout->addWidget( myData[ Y ] ); anOriGrpLayout->addWidget( new QLabel( tr( "GEOM_Z" ), anOriGrp ) ); - myData[ Z ] = new QDoubleSpinBox( anOriGrp ); + myData[ Z ] = new QtxDoubleSpinBox( anOriGrp ); anOriGrpLayout->addWidget( myData[ Z ] ); aMainGrpLayout->addWidget( anOriGrp ); @@ -114,13 +114,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th QVBoxLayout* aXAxisGrpLayout = new QVBoxLayout( aXAxisGrp ); aXAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), aXAxisGrp ) ); - myData[ DX1 ] = new QDoubleSpinBox( aXAxisGrp ); + myData[ DX1 ] = new QtxDoubleSpinBox( aXAxisGrp ); aXAxisGrpLayout->addWidget( myData[ DX1 ] ); aXAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), aXAxisGrp ) ); - myData[ DY1 ] = new QDoubleSpinBox( aXAxisGrp ); + myData[ DY1 ] = new QtxDoubleSpinBox( aXAxisGrp ); aXAxisGrpLayout->addWidget( myData[ DY1 ] ); aXAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), aXAxisGrp ) ); - myData[ DZ1 ] = new QDoubleSpinBox( aXAxisGrp ); + myData[ DZ1 ] = new QtxDoubleSpinBox( aXAxisGrp ); aXAxisGrpLayout->addWidget( myData[ DZ1 ] ); aMainGrpLayout->addWidget( aXAxisGrp ); @@ -129,13 +129,13 @@ BasicGUI_MarkerDlg::BasicGUI_MarkerDlg( GeometryGUI* theGeometryGUI, QWidget* th QVBoxLayout* anYAxisGrpLayout = new QVBoxLayout( anYAxisGrp ); anYAxisGrpLayout->addWidget( new QLabel( tr( "DX" ), anYAxisGrp ) ); - myData[ DX2 ] = new QDoubleSpinBox( anYAxisGrp ); + myData[ DX2 ] = new QtxDoubleSpinBox( anYAxisGrp ); anYAxisGrpLayout->addWidget( myData[ DX2 ] ); anYAxisGrpLayout->addWidget( new QLabel( tr( "DY" ), anYAxisGrp ) ); - myData[ DY2 ] = new QDoubleSpinBox( anYAxisGrp ); + myData[ DY2 ] = new QtxDoubleSpinBox( anYAxisGrp ); anYAxisGrpLayout->addWidget( myData[ DY2 ] ); anYAxisGrpLayout->addWidget( new QLabel( tr( "DZ" ), anYAxisGrp ) ); - myData[ DZ2 ] = new QDoubleSpinBox( anYAxisGrp ); + myData[ DZ2 ] = new QtxDoubleSpinBox( anYAxisGrp ); anYAxisGrpLayout->addWidget( myData[ DZ2 ] ); aMainGrpLayout->addWidget( anYAxisGrp ); diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.h b/src/BasicGUI/BasicGUI_MarkerDlg.h index 7dc5cd9a9..be0e91183 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.h +++ b/src/BasicGUI/BasicGUI_MarkerDlg.h @@ -32,7 +32,7 @@ class DlgRef_1Sel; class DlgRef_3Sel; -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QFrame; class BasicGUI_MarkerDlg : public GEOMBase_Skeleton @@ -41,7 +41,7 @@ class BasicGUI_MarkerDlg : public GEOMBase_Skeleton private: enum { X, Y, Z, DX1, DY1, DZ1, DX2, DY2, DZ2 }; - typedef QMap< int, QDoubleSpinBox* > DataMap; + typedef QMap< int, QtxDoubleSpinBox* > DataMap; public: BasicGUI_MarkerDlg( GeometryGUI*, QWidget* ); diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx index 040a64e90..053157a95 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.cxx @@ -111,7 +111,7 @@ void BlocksGUI_TrsfDlg::Init() { // Set range of spinboxes double SpecificStep = 1.0; - QMap::iterator anIter; + QMap::iterator anIter; for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { //anIter.data()->RangeStepAndValidator(1.0, 999.999, SpecificStep, 3); initSpinBox(anIter.value(), 1.0, MAX_NUMBER, SpecificStep, 3); @@ -127,7 +127,7 @@ void BlocksGUI_TrsfDlg::Init() for (anIterBtn = mySelBtn.begin(); anIterBtn != mySelBtn.end(); ++anIterBtn) connect(anIterBtn.value(), SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - QMap::iterator anIterSpin; + QMap::iterator anIterSpin; for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin) connect(anIterSpin.value(), SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); @@ -449,7 +449,7 @@ void BlocksGUI_TrsfDlg::createSpinWg (const QString& theLbl, const int theId) { QLabel* lab = new QLabel(theLbl, theParent); - mySpinBox[theId] = new QDoubleSpinBox(theParent); + mySpinBox[theId] = new QtxDoubleSpinBox(theParent); QGridLayout* l = 0; if (!theParent->layout()) { l = new QGridLayout(theParent); diff --git a/src/BlocksGUI/BlocksGUI_TrsfDlg.h b/src/BlocksGUI/BlocksGUI_TrsfDlg.h index 2087d481b..2706a2fc2 100644 --- a/src/BlocksGUI/BlocksGUI_TrsfDlg.h +++ b/src/BlocksGUI/BlocksGUI_TrsfDlg.h @@ -29,7 +29,7 @@ #include -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QGroupBox; class QPushButton; class QLineEdit; @@ -78,7 +78,7 @@ private: QMap mySelBtn; QMap mySelName; - QMap mySpinBox; + QMap mySpinBox; private slots: void ClickOnOk(); diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 591bc79ac..4709813df 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -25,6 +25,7 @@ #include "EntityGUI_SketcherDlg.h" #include "EntityGUI_Widgets.h" +#include #include #include @@ -277,7 +278,7 @@ bool EntityGUI_SketcherDlg::eventFilter (QObject* object, QEvent* event) if (event->type() == QEvent::KeyRelease) { // NPAL16010 (Sketcher Apply non available if only one line is modified) // To have Apply active as soon as value text changed - QDoubleSpinBox* aDoubleSpinBox = (QDoubleSpinBox*)object; + QtxDoubleSpinBox* aDoubleSpinBox = (QtxDoubleSpinBox*)object; if (aDoubleSpinBox) ValueChangedInSpinBox( aDoubleSpinBox->value() ); } diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index 02519e434..c634ea7f6 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -24,6 +24,7 @@ // #include "OperationGUI_ChamferDlg.h" +#include #include #include @@ -84,7 +85,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg (GeometryGUI* theGeometryGUI, Q int row = aLayout->rowCount(); aLayout->addWidget(new QLabel(tr("D"), myGrp1), row, 0); - aLayout->addWidget((mySpinBox[ SpinBox1 ] = new QDoubleSpinBox(myGrp1)), row++, 2); + aLayout->addWidget((mySpinBox[ SpinBox1 ] = new QtxDoubleSpinBox(myGrp1)), row++, 2); aLayout->setRowStretch(row, 10); // Create second group @@ -145,7 +146,7 @@ OperationGUI_ChamferDlg::OperationGUI_ChamferDlg (GeometryGUI* theGeometryGUI, Q // Set range of spinboxes double SpecificStep = 10.0; - QMap< int, QDoubleSpinBox* >::iterator anIter; + QMap< int, QtxDoubleSpinBox* >::iterator anIter; for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) { if (anIter.key() == SpinBox44 || anIter.key() == SpinBox34 || anIter.key() == SpinBox24) initSpinBox(anIter.value(), 0.001, 89.999, 5, 0); @@ -175,7 +176,7 @@ OperationGUI_ChamferDlg::~OperationGUI_ChamferDlg() void OperationGUI_ChamferDlg::Init() { // Set Initial values of spinboxes - QMap< int, QDoubleSpinBox* >::iterator anIter; + QMap< int, QtxDoubleSpinBox* >::iterator anIter; for (anIter = mySpinBox.begin(); anIter != mySpinBox.end(); ++anIter) anIter.value()->setValue(5); @@ -213,7 +214,7 @@ void OperationGUI_ChamferDlg::Init() this, SLOT(LineEditReturnPressed())); // spin boxes - QMap< int, QDoubleSpinBox* >::iterator anIterSpin; + QMap< int, QtxDoubleSpinBox* >::iterator anIterSpin; for (anIterSpin = mySpinBox.begin(); anIterSpin != mySpinBox.end(); ++anIterSpin) connect(anIterSpin.value(), SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); @@ -641,8 +642,8 @@ void OperationGUI_ChamferDlg::createRadioWg(const QString& theLbl1, myRadioButton[ theRbId ] = new QRadioButton(theParent); QLabel* lab1 = new QLabel(theLbl1, theParent); QLabel* lab2 = new QLabel(theLbl2, theParent); - mySpinBox[ theSpin1Id ] = new QDoubleSpinBox(theParent); - mySpinBox[ theSpin2Id ] = new QDoubleSpinBox(theParent); + mySpinBox[ theSpin1Id ] = new QtxDoubleSpinBox(theParent); + mySpinBox[ theSpin2Id ] = new QtxDoubleSpinBox(theParent); int row = theLayout->rowCount(); theLayout->addWidget(myRadioButton[ theRbId ], row, 0); theLayout->addWidget(lab1, row, 2); diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.h b/src/OperationGUI/OperationGUI_ChamferDlg.h index eb81ae377..4d3dd1652 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.h +++ b/src/OperationGUI/OperationGUI_ChamferDlg.h @@ -32,11 +32,10 @@ #include -class QDoubleSpinBox; class QGroupBox; class QPushButton; class QLineEdit; -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QGridLayout; class QRadioButton; @@ -106,7 +105,7 @@ private: QMap< int, QPushButton* > mySelBtn; QMap< int, QLineEdit* > mySelName; - QMap< int, QDoubleSpinBox* > mySpinBox; + QMap< int, QtxDoubleSpinBox* > mySpinBox; QMap< int, QRadioButton* > myRadioButton; }; diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.cxx b/src/OperationGUI/OperationGUI_ClippingDlg.cxx index 804ddc6cb..69403e730 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.cxx +++ b/src/OperationGUI/OperationGUI_ClippingDlg.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -73,13 +74,13 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( GeometryGUI* theGeometryGUI, TextLabelNear = new QLabel( tr( "Near" ), GroupArguments ); GroupArgumentsLayout->addWidget( TextLabelNear, 0, 0 ); - SpinBox_Near = new QDoubleSpinBox( GroupArguments ); + SpinBox_Near = new QtxDoubleSpinBox( COORD_MIN, COORD_MAX, 10.0, 3, 10, GroupArguments ); GroupArgumentsLayout->addWidget( SpinBox_Near, 0, 1 ); TextLabelFar = new QLabel( tr( "Far" ), GroupArguments ); GroupArgumentsLayout->addWidget( TextLabelFar, 0, 2 ); - SpinBox_Far = new QDoubleSpinBox( GroupArguments ); + SpinBox_Far = new QtxDoubleSpinBox( COORD_MIN, COORD_MAX, 10.0, 3, 10, GroupArguments ); GroupArgumentsLayout->addWidget( SpinBox_Far, 0, 3 ); resetButton = new QPushButton( tr( "Reset" ), GroupArguments ); @@ -96,10 +97,6 @@ OperationGUI_ClippingDlg::OperationGUI_ClippingDlg( GeometryGUI* theGeometryGUI, layout->setMargin( 0 ); layout->setSpacing( 6 ); layout->addWidget( GroupArguments ); - /* Initialisations */ - initSpinBox( SpinBox_Near, COORD_MIN, COORD_MAX, 10.0, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY - initSpinBox( SpinBox_Far, COORD_MIN, COORD_MAX, 10.0, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY - /* signals and slots connections */ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); diff --git a/src/OperationGUI/OperationGUI_ClippingDlg.h b/src/OperationGUI/OperationGUI_ClippingDlg.h index 7197f1386..79565effb 100644 --- a/src/OperationGUI/OperationGUI_ClippingDlg.h +++ b/src/OperationGUI/OperationGUI_ClippingDlg.h @@ -32,7 +32,7 @@ class QGroupBox; class QLabel; class QPushButton; class QComboBox; -class QDoubleSpinBox; +class QtxDoubleSpinBox; enum ViewerTypes { VTK, OCC, OTHER }; @@ -58,9 +58,9 @@ private: QGroupBox* GroupArguments; QLabel* TextLabelNear; - QDoubleSpinBox* SpinBox_Near; + QtxDoubleSpinBox* SpinBox_Near; QLabel* TextLabelFar; - QDoubleSpinBox* SpinBox_Far; + QtxDoubleSpinBox* SpinBox_Far; QPushButton* resetButton; QComboBox* TypeCB; diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 7cea1fd99..71bb7db83 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -83,8 +84,7 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q myIsParameterGr->addButton( rb2, 1 ); rb1->setChecked( true ); - myValEdt = new QDoubleSpinBox( GroupPoints->Box ); - initSpinBox( myValEdt, 0., 1., 0.1, 3 ); + myValEdt = new QtxDoubleSpinBox( 0., 1., 0.1, 3, 32, GroupPoints->Box ); myValEdt->setValue( 0.5 ); QLabel* aLbl1 = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->Box ); diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.h b/src/RepairGUI/RepairGUI_DivideEdgeDlg.h index 59de84f19..aa11042b1 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.h +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.h @@ -29,7 +29,7 @@ #include class DlgRef_1SelExt; -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QButtonGroup; //================================================================================= @@ -63,7 +63,7 @@ private: DlgRef_1SelExt* GroupPoints; QButtonGroup* myIsParameterGr; - QDoubleSpinBox* myValEdt; + QtxDoubleSpinBox* myValEdt; protected slots: void ClickOnOk(); diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index c3ddfef0e..e361209e2 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -81,8 +82,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg( GeometryGUI* theGeometryGUI, QWidget* pare GroupPoints->LineEdit1->setReadOnly( true ); QLabel* aTolLab = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box ); - myTolEdt = new QDoubleSpinBox( GroupPoints->Box ); - initSpinBox( myTolEdt, 0, 100, 1e-7, 7 ); + myTolEdt = new QtxDoubleSpinBox( 0.0, 100.0, DEFAULT_TOLERANCE_VALUE, 7, 7, GroupPoints->Box ); myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE ); QGridLayout* boxLayout = new QGridLayout( GroupPoints->Box ); @@ -98,7 +98,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg( GeometryGUI* theGeometryGUI, QWidget* pare GroupPoints2->LineEdit1->setReadOnly( true ); QLabel* aTolLab2 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints2->Box ); - myTolEdt2 = new QDoubleSpinBox( GroupPoints2->Box ); + myTolEdt2 = new QtxDoubleSpinBox( GroupPoints2->Box ); initSpinBox( myTolEdt2, 0, 100, 1e-7, 7 ); myTolEdt2->setValue( DEFAULT_TOLERANCE_VALUE ); diff --git a/src/RepairGUI/RepairGUI_GlueDlg.h b/src/RepairGUI/RepairGUI_GlueDlg.h index efdd034d2..26b33e185 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.h +++ b/src/RepairGUI/RepairGUI_GlueDlg.h @@ -29,7 +29,7 @@ #include class DlgRef_1SelExt; -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QPushButton; class QCheckBox; @@ -73,8 +73,8 @@ private: DlgRef_1SelExt* GroupPoints; DlgRef_1SelExt* GroupPoints2; - QDoubleSpinBox* myTolEdt; - QDoubleSpinBox* myTolEdt2; + QtxDoubleSpinBox* myTolEdt; + QtxDoubleSpinBox* myTolEdt2; QPushButton* myDetectBtn; QCheckBox* mySubShapesChk; diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index a6d8f1cba..066c935a4 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -69,13 +70,12 @@ RepairGUI_SewingDlg::RepairGUI_SewingDlg( GeometryGUI* theGeometryGUI, QWidget* GroupPoints = new DlgRef_1SelExt( centralWidget() ); GroupPoints->GroupBox1->setTitle( tr( "GEOM_SEWING" ) ); GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPE" ) ); - GroupPoints->PushButton1->setIcon( image1 ); + GroupPoints->PushButton1->setIxcon( image1 ); GroupPoints->LineEdit1->setReadOnly( true ); QGridLayout* aLay = new QGridLayout( GroupPoints->Box ); aLay->setMargin( 0 ); aLay->setSpacing( 6 ); - myTolEdt = new QDoubleSpinBox( GroupPoints->Box ); - initSpinBox( myTolEdt, 0, 100, 1e-7, 10 ); + myTolEdt = new QtxDoubleSpinBox( 0.0, 100.0, DEFAULT_TOLERANCE_VALUE, 7, 10, GroupPoints->Box ); myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE ); QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->Box ); myFreeBoundBtn = new QPushButton( tr( "GEOM_DETECT" ) + QString( " [%1]" ).arg( tr( "GEOM_FREE_BOUNDARIES" ) ), diff --git a/src/RepairGUI/RepairGUI_SewingDlg.h b/src/RepairGUI/RepairGUI_SewingDlg.h index 4830d979c..0c170ca6e 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.h +++ b/src/RepairGUI/RepairGUI_SewingDlg.h @@ -29,7 +29,7 @@ #include class DlgRef_1SelExt; -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QPushButton; //================================================================================= @@ -59,7 +59,7 @@ private: GEOM::GEOM_Object_var myObject; DlgRef_1SelExt* GroupPoints; - QDoubleSpinBox* myTolEdt; + QtxDoubleSpinBox* myTolEdt; QPushButton* myFreeBoundBtn; int myClosed; // Number of free closed boundaries detected. Calculated in execute(), used in onDetect(). diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index 1abf61dc1..2d7f15407 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -123,10 +124,8 @@ void RepairGUI_ShapeProcessDlg::init() QGridLayout* aLay = new QGridLayout( w ); aLay->setMargin( 9 ); aLay->setSpacing( 6 ); - myFixShapeTol3D = new QDoubleSpinBox( w ); - initSpinBox( myFixShapeTol3D, 0, 100, 1e-7, 10 ); - myFixShapeMaxTol3D = new QDoubleSpinBox( w ); - initSpinBox( myFixShapeMaxTol3D, 0, 100, 1e-7, 10 ); + myFixShapeTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); + myFixShapeMaxTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 ); aLay->addWidget( myFixShapeTol3D, 0, 1 ); @@ -140,8 +139,7 @@ void RepairGUI_ShapeProcessDlg::init() QGridLayout* aLay = new QGridLayout( w ); aLay->setMargin( 9 ); aLay->setSpacing( 6 ); - myFixFaceSizeTol = new QDoubleSpinBox( w ); - initSpinBox( myFixFaceSizeTol, 0, 100, 1e-7, 10 ); + myFixFaceSizeTol = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); aLay->addWidget( new QLabel( tr( "GEOM_TOLERANCE" ), w ), 0, 0 ); aLay->addWidget( myFixFaceSizeTol, 0, 1 ); @@ -153,8 +151,7 @@ void RepairGUI_ShapeProcessDlg::init() QGridLayout* aLay = new QGridLayout( w ); aLay->setMargin( 9 ); aLay->setSpacing( 6 ); - myDropSmallEdgesTol3D = new QDoubleSpinBox( w ); - initSpinBox( myDropSmallEdgesTol3D, 0, 100, 1e-7, 10 ); + myDropSmallEdgesTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 ); aLay->addWidget( myDropSmallEdgesTol3D, 0, 1 ); @@ -166,10 +163,8 @@ void RepairGUI_ShapeProcessDlg::init() QGridLayout* aLay = new QGridLayout( w ); aLay->setMargin( 9 ); aLay->setSpacing( 6 ); - mySplitAngleAngle = new QDoubleSpinBox( w ); - initSpinBox( mySplitAngleAngle, 0, 360, 1 ); - mySplitAngleMaxTol = new QDoubleSpinBox( w ); - initSpinBox( mySplitAngleMaxTol, 0, 100, 1e-7, 10 ); + mySplitAngleAngle = new QtxDoubleSpinBox( 0, 360, 1, 10, 10, w ); + mySplitAngleMaxTol = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); aLay->addWidget( new QLabel( tr( "GEOM_ANGLE_1" ), w ), 0, 0 ); aLay->addWidget( mySplitAngleAngle, 0, 1 ); @@ -195,8 +190,7 @@ void RepairGUI_ShapeProcessDlg::init() QGridLayout* aLay = new QGridLayout( w ); aLay->setMargin( 9 ); aLay->setSpacing( 6 ); - mySplitContTol3D = new QDoubleSpinBox( w ); - initSpinBox( mySplitContTol3D, 0, 100, 1e-7, 10 ); + mySplitContTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); mySplitContSurfCont = new QComboBox( w ); mySplitContSurfCont->addItems( aContinueties ); mySplitContCurvCont = new QComboBox( w ); @@ -220,11 +214,9 @@ void RepairGUI_ShapeProcessDlg::init() myBSpline3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w ); myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w ); - myBSplineTol3D = new QDoubleSpinBox( w ); - initSpinBox( myBSplineTol3D, 0, 100, 1e-7, 10 ); + myBSplineTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); - myBSplineTol2D = new QDoubleSpinBox( w ); - initSpinBox( myBSplineTol2D, 0, 100, 1e-7, 10 ); + myBSplineTol2D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); myBSplineDegree = new QSpinBox( w ); myBSplineSegments = new QSpinBox( w ); @@ -264,8 +256,7 @@ void RepairGUI_ShapeProcessDlg::init() myToBezier3DCurveChk = new QCheckBox( tr("GEOM_3D_CURVE_MODE"), w ); myToBezier2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w ); - myToBezierMaxTol = new QDoubleSpinBox( w ); - initSpinBox( myToBezierMaxTol, 0, 100, 1e-7, 10 ); + myToBezierMaxTol = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); aLay->addWidget( myToBezierSurfModeChk, 0, 0 ); aLay->addWidget( myToBezier3DCurveChk, 1, 0 ); @@ -280,8 +271,7 @@ void RepairGUI_ShapeProcessDlg::init() QGridLayout* aLay = new QGridLayout( w ); aLay->setMargin( 9 ); aLay->setSpacing( 6 ); - mySameParameterTol3D = new QDoubleSpinBox( w ); - initSpinBox( mySameParameterTol3D, 0, 100, 1e-7, 10 ); + mySameParameterTol3D = new QtxDoubleSpinBox( 0., 100., 1e-7, 10, 10, w ); aLay->addWidget( new QLabel( tr( "GEOM_3D_TOLERANCE" ), w ), 0, 0 ); aLay->addWidget( mySameParameterTol3D, 0, 1 ); @@ -508,8 +498,8 @@ void RepairGUI_ShapeProcessDlg::loadDefaults() void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& theValue ) { if ( theControl && !theValue.isNull() ) { - if ( qobject_cast( theControl ) ) - qobject_cast( theControl )->setValue( theValue.toDouble() ); + if ( qobject_cast( theControl ) ) + qobject_cast( theControl )->setValue( theValue.toDouble() ); else if ( qobject_cast( theControl ) ) qobject_cast( theControl )->setValue( theValue.toInt() ); else if ( qobject_cast( theControl ) ) @@ -526,8 +516,8 @@ void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& th QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const { if ( theControl ) { - if ( qobject_cast( theControl ) ) - return QString::number( qobject_cast( theControl )->value() ); + if ( qobject_cast( theControl ) ) + return QString::number( qobject_cast( theControl )->value() ); else if ( qobject_cast( theControl ) ) return QString::number( qobject_cast( theControl )->value() ); else if ( qobject_cast( theControl ) ) diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h index 4cfd35302..47b1b69fe 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.h +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.h @@ -32,7 +32,7 @@ class DlgRef_1Sel; class QSpinBox; -class QDoubleSpinBox; +class QtxDoubleSpinBox; class QComboBox; class QCheckBox; class QListWidget; @@ -84,27 +84,27 @@ private: DlgRef_1Sel* mySelectWdgt; QListWidget* myOpList; - QDoubleSpinBox* myFixShapeTol3D; - QDoubleSpinBox* myFixShapeMaxTol3D; + QtxDoubleSpinBox* myFixShapeTol3D; + QtxDoubleSpinBox* myFixShapeMaxTol3D; - QDoubleSpinBox* myFixFaceSizeTol; + QtxDoubleSpinBox* myFixFaceSizeTol; - QDoubleSpinBox* myDropSmallEdgesTol3D; + QtxDoubleSpinBox* myDropSmallEdgesTol3D; - QDoubleSpinBox* mySplitAngleAngle; - QDoubleSpinBox* mySplitAngleMaxTol; + QtxDoubleSpinBox* mySplitAngleAngle; + QtxDoubleSpinBox* mySplitAngleMaxTol; QSpinBox* mySplitClosedFacesNum; - QDoubleSpinBox* mySplitContTol3D; + QtxDoubleSpinBox* mySplitContTol3D; QComboBox* mySplitContSurfCont; QComboBox* mySplitContCurvCont; QCheckBox* myBSplineSurfModeChk; QCheckBox* myBSpline3DCurveChk; QCheckBox* myBSpline2DCurveChk; - QDoubleSpinBox* myBSplineTol3D; - QDoubleSpinBox* myBSplineTol2D; + QtxDoubleSpinBox* myBSplineTol3D; + QtxDoubleSpinBox* myBSplineTol2D; QSpinBox* myBSplineDegree; QSpinBox* myBSplineSegments; QComboBox* myBSpline2DCont; @@ -113,9 +113,9 @@ private: QCheckBox* myToBezierSurfModeChk; QCheckBox* myToBezier3DCurveChk; QCheckBox* myToBezier2DCurveChk; - QDoubleSpinBox* myToBezierMaxTol; + QtxDoubleSpinBox* myToBezierMaxTol; - QDoubleSpinBox* mySameParameterTol3D; + QtxDoubleSpinBox* mySameParameterTol3D; private slots: void onOk(); -- 2.39.2