From: ouv Date: Thu, 10 Apr 2008 12:18:58 +0000 (+0000) Subject: Bug IPAL19515 - Qt4 porting. Smoothing. Name of whole mesh, submesh or group doesn... X-Git-Tag: V5_0_0~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=39b202e1bb5679758a8da044b1c5e994f44335cf;p=modules%2Fsmesh.git Bug IPAL19515 - Qt4 porting. Smoothing. Name of whole mesh, submesh or group doesn't appear. --- diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index e4920f9c9..b0656be9e 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -154,6 +154,8 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments); GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection ElementsLab = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); @@ -161,7 +163,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod SelectElementsButton->setIcon(selectImage); ElementsLineEdit = new QLineEdit(GroupArguments); - ElementsLineEdit->setValidator(new SMESHGUI_IdValidator(this)); + ElementsLineEdit->setValidator(myIdValidator); // Controls for the whole mesh selection MeshCheck = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -1110,6 +1112,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::onSelectMesh() bool toSelectMesh = MeshCheck->isChecked(); ElementsLineEdit->setReadOnly(toSelectMesh); + ElementsLineEdit->setValidator(toSelectMesh ? 0 : myIdValidator); ElementsLab->setText(toSelectMesh ? tr("SMESH_NAME") : tr("SMESH_ID_ELEMENTS")); ElementsLineEdit->clear(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h index 6f75d5269..82e019157 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h @@ -48,6 +48,7 @@ class QPushButton; class SMESHGUI; class SMESH_Actor; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SVTK_Selector; class LightApp_SelectionMgr; @@ -78,6 +79,7 @@ private: void SetEditCurrentArgument( QToolButton* ); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ SVTK_Selector* mySelector; diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index e1fe9721e..7f8ac1673 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -148,6 +148,8 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule) GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); @@ -155,7 +157,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule) SelectElementsButton->setIcon(image2); LineEditElements = new QLineEdit(GroupArguments); - LineEditElements->setValidator(new SMESHGUI_IdValidator(this)); + LineEditElements->setValidator(myIdValidator); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -707,6 +709,7 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh) aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); LineEditElements->setReadOnly(true); + LineEditElements->setValidator(0); } else { int aConstructorId = GetConstructorId(); if (aConstructorId == 0) @@ -721,6 +724,7 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh) } LineEditElements->setReadOnly(false); + LineEditElements->setValidator(myIdValidator); onTextChange(LineEditElements->text()); } diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h index 3b4b28fb6..f9cffd5d2 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h @@ -50,6 +50,7 @@ class QPushButton; class SMESHGUI; class SMESH_Actor; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SVTK_Selector; class LightApp_SelectionMgr; @@ -74,6 +75,7 @@ private: int GetConstructorId(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ QLineEdit* myEditCurrentArgument; /* Current LineEdit */ int myNbOkElements; /* to check when elements are defined */ diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index 108a5f9eb..2b8e1f364 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -123,6 +123,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); @@ -130,7 +132,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) SelectElementsButton->setIcon(image2); LineEditElements = new QLineEdit(GroupArguments); - LineEditElements->setValidator(new SMESHGUI_IdValidator(this)); + LineEditElements->setValidator(myIdValidator); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -852,6 +854,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh) aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); LineEditElements->setReadOnly(true); + LineEditElements->setValidator(0); } else { int aConstructorId = GetConstructorId(); if (aConstructorId == 0) @@ -866,6 +869,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh) } LineEditElements->setReadOnly(false); + LineEditElements->setValidator(myIdValidator); onTextChange(LineEditElements->text()); } diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h index 3e2ed3a71..098cf7a18 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h @@ -44,6 +44,7 @@ class QPushButton; class QRadioButton; class QCheckBox; class QSpinBox; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SMESHGUI; class SMESH_Actor; @@ -73,6 +74,7 @@ private: bool IsAxisOk(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ int myNbOkElements; /* to check when elements are defined */ QString myElementsId; diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 914562d31..4a6f93a01 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -121,12 +121,14 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); SelectElementsButton = new QPushButton(GroupArguments); SelectElementsButton->setIcon(image1); LineEditElements = new QLineEdit(GroupArguments); - LineEditElements->setValidator(new SMESHGUI_IdValidator(this)); + LineEditElements->setValidator(myIdValidator); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -796,10 +798,12 @@ void SMESHGUI_RotationDlg::onSelectMesh (bool toSelectMesh) aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); LineEditElements->setReadOnly(true); + LineEditElements->setValidator(0); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode( CellSelection ); LineEditElements->setReadOnly(false); + LineEditElements->setValidator(myIdValidator); onTextChange(LineEditElements->text()); } diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.h b/src/SMESHGUI/SMESHGUI_RotationDlg.h index fe311fffb..bee73659c 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.h +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.h @@ -45,6 +45,7 @@ class QRadioButton; class QCheckBox; class SMESHGUI; class SMESH_Actor; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SVTK_Selector; class LightApp_SelectionMgr; @@ -72,6 +73,7 @@ private: void setNewMeshName(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ int myNbOkElements; /* to check when elements are defined */ QString myElementsId; diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 4b9134bc3..b1562d899 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -123,6 +123,8 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); @@ -130,7 +132,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) SelectElementsButton->setIcon(image1); LineEditElements = new QLineEdit(GroupArguments); - LineEditElements->setValidator(new SMESHGUI_IdValidator(this)); + LineEditElements->setValidator(myIdValidator); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -142,7 +144,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) SelectNodesButton->setIcon(image1); LineEditNodes = new QLineEdit(GroupArguments); - LineEditNodes->setValidator(new SMESHGUI_IdValidator(this)); + LineEditNodes->setValidator(myIdValidator); // Controls for method selection TextLabelMethod = new QLabel(tr("METHOD"), GroupArguments); @@ -723,10 +725,12 @@ void SMESHGUI_SmoothingDlg::onSelectMesh (bool toSelectMesh) mySelectionMgr->setSelectionModes(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); LineEditElements->setReadOnly(true); + LineEditElements->setValidator(0); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(CellSelection); LineEditElements->setReadOnly(false); + LineEditElements->setValidator(myIdValidator); onTextChange(LineEditElements->text()); } diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h index c36459a1d..cf9d195ff 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h @@ -44,6 +44,7 @@ class QRadioButton; class QComboBox; class QCheckBox; class QSpinBox; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SMESHGUI; class SMESH_Actor; @@ -71,6 +72,7 @@ private: void keyPressEvent( QKeyEvent* ); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ QString myElementsId; int myNbOkElements; /* to check when elements are defined */ diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 0485ab516..744c71109 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -132,12 +132,14 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); SelectElementsButton = new QPushButton(GroupArguments); SelectElementsButton->setIcon(image3); LineEditElements = new QLineEdit(GroupArguments); - LineEditElements->setValidator(new SMESHGUI_IdValidator(this)); + LineEditElements->setValidator(myIdValidator); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -880,10 +882,12 @@ void SMESHGUI_SymmetryDlg::onSelectMesh (bool toSelectMesh) aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); LineEditElements->setReadOnly(true); + LineEditElements->setValidator(0); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(CellSelection); LineEditElements->setReadOnly(false); + LineEditElements->setValidator(myIdValidator); onTextChange(LineEditElements->text()); } diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h index c1602a8f6..faa9eebfa 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h @@ -43,6 +43,7 @@ class QLineEdit; class QPushButton; class QRadioButton; class QCheckBox; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SMESHGUI; class SMESH_Actor; @@ -73,6 +74,7 @@ private: void setNewMeshName(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ int myNbOkElements; /* to check when elements are defined */ QString myElementsId; diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 6c520a0e4..f82fc7584 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -127,12 +127,14 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN); + myIdValidator = new SMESHGUI_IdValidator(this); + // Controls for elements selection TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments); SelectElementsButton = new QPushButton(GroupArguments); SelectElementsButton->setIcon(image2); LineEditElements = new QLineEdit(GroupArguments); - LineEditElements->setValidator(new SMESHGUI_IdValidator(this)); + LineEditElements->setValidator(myIdValidator); // Control for the whole mesh selection CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments); @@ -851,10 +853,12 @@ void SMESHGUI_TranslationDlg::onSelectMesh (bool toSelectMesh) aViewWindow->SetSelectionMode( ActorSelection ); mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter); LineEditElements->setReadOnly(true); + LineEditElements->setValidator(0); } else { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode( CellSelection ); LineEditElements->setReadOnly(false); + LineEditElements->setValidator(myIdValidator); onTextChange(LineEditElements->text()); } diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.h b/src/SMESHGUI/SMESHGUI_TranslationDlg.h index 2bc68ca7e..7fd24a930 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.h +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.h @@ -44,6 +44,7 @@ class QPushButton; class QRadioButton; class QCheckBox; class SMESHGUI; +class SMESHGUI_IdValidator; class SMESHGUI_SpinBox; class SMESH_Actor; class SVTK_Selector; @@ -72,6 +73,7 @@ private: void setNewMeshName(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ + SMESHGUI_IdValidator* myIdValidator; LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ QString myElementsId; int myNbOkElements; /* to check when elements are defined */