From: akl Date: Thu, 21 Feb 2013 12:10:00 +0000 (+0000) Subject: 0022123: EDF 2558 SMESH: Group creation crashs with the filter "Free faces": X-Git-Tag: pluginMGCleaner~113 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2770bdc924e08cc31c624442fc60d809854a8e93;p=modules%2Fsmesh.git 0022123: EDF 2558 SMESH: Group creation crashs with the filter "Free faces": using reject() slot instead of closeEvent() and hideEvent(). --- diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 8d77bc357..ce220e259 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -441,7 +441,7 @@ void SMESHGUI_AddMeshElementDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp())); @@ -450,8 +450,8 @@ void SMESHGUI_AddMeshElementDlg::Init() connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument())); /* to close dialog if study frame change */ - connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(ClickOnCancel())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(reject())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); if (Reverse) connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int))); @@ -599,14 +599,14 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() void SMESHGUI_AddMeshElementDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_AddMeshElementDlg::ClickOnCancel() +void SMESHGUI_AddMeshElementDlg::reject() { //mySelectionMgr->clearSelected(); mySimulation->SetVisibility(false); @@ -615,7 +615,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel() aViewWindow->SetSelectionMode( ActorSelection ); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -874,26 +874,6 @@ void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//================================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//================================================================================= -void SMESHGUI_AddMeshElementDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : CheckBox() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h index 72ad06d93..d5f420eb1 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h @@ -71,8 +71,6 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); - void hideEvent( QHideEvent* ); /* ESC key */ void enterEvent( QEvent* ); /* mouse enter the QWidget */ void keyPressEvent( QKeyEvent* ); void displaySimulation(); @@ -119,9 +117,11 @@ private: QString myHelpFileName; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index c4bc516ad..3a72de152 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -628,13 +628,13 @@ void SMESHGUI_AddQuadraticElementDlg::Init() connect(myReverseCB, SIGNAL(stateChanged(int)), SLOT(onReverse(int))); connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog())); - connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel())); - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject())); myCurrentLineEdit = myCornerNodes; @@ -803,14 +803,14 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply() void SMESHGUI_AddQuadraticElementDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel() +void SMESHGUI_AddQuadraticElementDlg::reject() { mySelectionMgr->clearSelected(); mySimulation->SetVisibility(false); @@ -819,7 +819,7 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel() aViewWindow->SetSelectionMode( ActorSelection ); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -1134,26 +1134,6 @@ void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_AddQuadraticElementDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//================================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//================================================================================= -void SMESHGUI_AddQuadraticElementDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : onReverse() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h index 3b2c360b2..7ef580022 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.h @@ -73,8 +73,6 @@ private: typedef QList GrpList; void Init(); - void closeEvent( QCloseEvent* ); - void hideEvent( QHideEvent* ); /* ESC key */ void enterEvent( QEvent* ); /* mouse enter the QWidget */ void keyPressEvent( QKeyEvent* ); void displaySimulation(); @@ -128,6 +126,9 @@ private: QString myHelpFileName; +protected slots: + virtual void reject(); + private slots: void onTextChange( const QString& ); void onCellTextChange( int, int ); @@ -135,7 +136,6 @@ private slots: void onCellDoubleClicked( int, int ); void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); void SetCurrentSelection(); diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx index cadd4593f..3ca0fff25 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.cxx @@ -212,7 +212,7 @@ void SMESHGUI_BuildCompoundDlg::Init() // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -223,7 +223,7 @@ void SMESHGUI_BuildCompoundDlg::Init() connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH"))); LineEditMeshes->setFocus(); @@ -366,20 +366,20 @@ void SMESHGUI_BuildCompoundDlg::ClickOnOk() { setIsApplyAndClose( true ); if (ClickOnApply()) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_BuildCompoundDlg::ClickOnCancel() +void SMESHGUI_BuildCompoundDlg::reject() { //mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -480,27 +480,6 @@ void SMESHGUI_BuildCompoundDlg::enterEvent( QEvent* ) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_BuildCompoundDlg::closeEvent( QCloseEvent* ) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_BuildCompoundDlg::hideEvent( QHideEvent* ) -{ - if (!isMinimized()) - ClickOnCancel(); -} - - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h index 6230022e8..a5890252c 100644 --- a/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h +++ b/src/SMESHGUI/SMESHGUI_BuildCompoundDlg.h @@ -68,9 +68,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); bool isValid(); @@ -115,9 +113,11 @@ private: bool myIsApplyAndClose; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SelectionIntoArgument(); diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 993f69f28..c359f18a6 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -479,12 +479,12 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule, SVTK_ViewWindow connect(PreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(OnPreviewToggle(bool))); connect(AutoApplyCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAutoApply(bool))); connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); /* to close dialog if study frame change */ - connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(reject())); this->show(); } @@ -589,16 +589,17 @@ void SMESHGUI_ClippingDlg::ClickOnApply() void SMESHGUI_ClippingDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //======================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //======================================================================= -void SMESHGUI_ClippingDlg::ClickOnCancel() +void SMESHGUI_ClippingDlg::reject() { - close(); + //here we can insert actions to do at close. + QDialog::reject(); } //================================================================================= diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.h b/src/SMESHGUI/SMESHGUI_ClippingDlg.h index e8cb095f8..3ade2c9c7 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.h +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.h @@ -192,6 +192,9 @@ private: bool myIsSelectPlane; QString myHelpFileName; +protected slots: + virtual void reject(); + public slots: void onSelectPlane( int ); void ClickOnNew(); @@ -203,7 +206,6 @@ public slots: void OnPreviewToggle( bool ); void onAutoApply(bool); void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); }; diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index dab7a224c..6a3b9038b 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -227,7 +227,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -236,7 +236,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule ) connect(mySelectionMgr, SIGNAL (currentSelectionChanged()), this, SLOT (SelectionIntoArgument())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */ - this, SLOT (ClickOnCancel())); + this, SLOT (reject())); connect(myLineEditElements, SIGNAL(textChanged(const QString&)), this, SLOT (onTextChange(const QString&))); @@ -369,14 +369,14 @@ void SMESHGUI_CopyMeshDlg::ClickOnOk() { setIsApplyAndClose( true ); if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_CopyMeshDlg::ClickOnCancel() +void SMESHGUI_CopyMeshDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); if ( mySelectionMgr ) @@ -384,7 +384,7 @@ void SMESHGUI_CopyMeshDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode( ActorSelection ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -618,26 +618,6 @@ void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_CopyMeshDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_CopyMeshDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h index b0c3b9338..d39f9cc5c 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.h @@ -65,9 +65,7 @@ public: private: void Init( bool = true ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); void setNewMeshName(); @@ -114,9 +112,11 @@ private: bool myIsApplyAndClose; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SelectionIntoArgument(); diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index ac3c71931..9413696e9 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -230,7 +230,7 @@ QWidget* SMESHGUI_CreatePatternDlg::createButtonFrame( QWidget* theParent ) aLay->addWidget( myHelpBtn ); connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) ); - connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( onClose() ) ); + connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( mySaveBtn, SIGNAL( clicked() ), this, SLOT( onSave() ) ); connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); @@ -279,7 +279,7 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType ) connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( onDeactivate() ) ); connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), - this, SLOT( onClose() ) ); + this, SLOT( reject() ) ); mySwitch2d->setEnabled( theType == Type_2d ); mySwitch3d->setEnabled( theType == Type_3d ); @@ -482,17 +482,17 @@ void SMESHGUI_CreatePatternDlg::onOk() } //======================================================================= -// function : onClose() +// function : reject() // purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_CreatePatternDlg::onClose() +void SMESHGUI_CreatePatternDlg::reject() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) aViewWindow->SetSelectionMode( ActorSelection ); disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySMESHGUI, 0, this, 0 ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); emit Close(); } @@ -648,15 +648,6 @@ void SMESHGUI_CreatePatternDlg::enterEvent( QEvent* ) } } -//================================================================================= -// function : closeEvent() -// purpose : Close dialog box -//================================================================================= -void SMESHGUI_CreatePatternDlg::closeEvent( QCloseEvent* ) -{ - onClose(); -} - //======================================================================= // function : onSelBtnClicked() // purpose : SLOT. Called when -> button clicked. diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h index 0a03e1061..096ce40fc 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h @@ -74,14 +74,13 @@ signals: void Close(); private: - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); private slots: void onOk(); void onSave(); - void onClose(); + void reject(); void onHelp(); void onDeactivate(); diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index 73eae4dd2..8fdd03e6f 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -335,7 +335,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) ); - connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) ); + connect(buttonCancel, SIGNAL( clicked() ), SLOT( reject() ) ); connect(buttonApply, SIGNAL( clicked() ), SLOT( ClickOnApply() ) ); connect(buttonHelp, SIGNAL( clicked() ), SLOT( ClickOnHelp() ) ); @@ -351,7 +351,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init() connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool))); /* to close dialog if study change */ - connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); + connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) ); ConstructorsClicked(0); SelectionIntoArgument(); @@ -589,15 +589,15 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk() { if(checkEditLine(false) == -1) {return;} ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel() +void SMESHGUI_CreatePolyhedralVolumeDlg::reject() { mySelectionMgr->clearFilters(); //SALOME_ListIO aList; @@ -608,7 +608,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel() aViewWindow->SetSelectionMode( ActorSelection ); disconnect( mySelectionMgr, 0, this, 0 ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -1037,30 +1037,6 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e) ActivateThisDialog(); } - -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_CreatePolyhedralVolumeDlg::closeEvent( QCloseEvent* e ) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= - -void SMESHGUI_CreatePolyhedralVolumeDlg::hideEvent ( QHideEvent * e ) -{ - if ( !isMinimized() ) - ClickOnCancel(); -} - - //================================================================================= // function : GetConstructorId() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h index 44dd3ab5d..f0c2e77f3 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h @@ -72,9 +72,7 @@ private: typedef QList GrpList; void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); void displaySimulation(); @@ -125,11 +123,13 @@ public slots: void onAdd(); void onRemove(); +protected slots: + virtual void reject(); + private slots: void ConstructorsClicked( int ); void ClickOnPreview( bool ); void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index 7b2c6e27a..3200bc02f 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -146,7 +146,7 @@ QWidget* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent) // connect signals and slots connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); @@ -173,7 +173,7 @@ void SMESHGUI_DeleteGroupDlg::Init () // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); // set selection mode mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::GROUP)); @@ -239,14 +239,14 @@ bool SMESHGUI_DeleteGroupDlg::onApply() void SMESHGUI_DeleteGroupDlg::onOk() { if (onApply()) - onClose(); + reject(); } //================================================================================= -// function : onClose() +// function : reject() // purpose : SLOT called when "Close" button pressed. Close dialog //================================================================================= -void SMESHGUI_DeleteGroupDlg::onClose() +void SMESHGUI_DeleteGroupDlg::reject() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); @@ -254,7 +254,7 @@ void SMESHGUI_DeleteGroupDlg::onClose() disconnect(mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); mySelectionMgr->clearFilters(); - reject(); + QDialog::reject(); } //================================================================================= @@ -334,15 +334,6 @@ void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*) mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP)); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_DeleteGroupDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h index 76f6bd5b0..12ccb0023 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h @@ -59,14 +59,15 @@ public: void Init (); private: - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); +protected slots: + virtual void reject(); + private slots: void onOk(); bool onApply(); - void onClose(); void onHelp(); void onDeactivate(); diff --git a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx index 1ee5ab8c9..0c49d152e 100644 --- a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx @@ -214,14 +214,14 @@ SMESHGUI_DuplicateNodesDlg::SMESHGUI_DuplicateNodesDlg( SMESHGUI* theModule ) connect(mySelectButton3, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument())); connect(myButtonOk, SIGNAL(clicked()), this, SLOT(onOk())); - connect(myButtonClose, SIGNAL(clicked()), this, SLOT(onClose())); + connect(myButtonClose, SIGNAL(clicked()), this, SLOT(reject())); connect(myButtonApply, SIGNAL(clicked()), this, SLOT(onApply())); connect(myButtonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionChanged())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(onClose())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); } /*! @@ -425,19 +425,19 @@ bool SMESHGUI_DuplicateNodesDlg::onApply() void SMESHGUI_DuplicateNodesDlg::onOk() { if (onApply()) - onClose(); + reject(); } /*! \brief SLOT called to close the dialog. */ -void SMESHGUI_DuplicateNodesDlg::onClose() +void SMESHGUI_DuplicateNodesDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); mySelectionMgr->clearFilters(); - reject(); + QDialog::reject(); } /*! @@ -575,15 +575,6 @@ void SMESHGUI_DuplicateNodesDlg::enterEvent (QEvent*) } } -/*! - \brief Receive close events. - Reimplemented from QWidget class. -*/ -void SMESHGUI_DuplicateNodesDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - /*! \brief Receive key press events. Reimplemented from QWidget class. diff --git a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.h b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.h index 2714ba093..ac91720b6 100644 --- a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.h @@ -65,15 +65,16 @@ private: bool isValid(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); +protected slots: + virtual void reject(); + private slots: void onConstructorsClicked( int ); void onOk(); - void onClose(); bool onApply(); void onHelp(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index d23c6dc33..5a2c3eba6 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -305,7 +305,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule) /***************************************************************/ // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -326,7 +326,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule) connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); @@ -664,16 +664,28 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply() void SMESHGUI_ExtrusionDlg::ClickOnOk() { if (ClickOnApply()) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : Called when dialog box is closed //================================================================================= -void SMESHGUI_ExtrusionDlg::ClickOnCancel() +void SMESHGUI_ExtrusionDlg::reject() { - reject(); + disconnect(mySelectionMgr, 0, this, 0); + mySelectionMgr->clearFilters(); + //mySelectionMgr->clearSelected(); + if (SMESH::GetCurrentVtkView()) { + SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters + SMESH::SetPointRepresentation(false); + SMESH::SetPickable(); + } + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + mySMESHGUI->ResetState(); + + QDialog::reject(); } //================================================================================= @@ -998,32 +1010,6 @@ void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_ExtrusionDlg::closeEvent( QCloseEvent* ) -{ - /* same than click on cancel button */ - disconnect(mySelectionMgr, 0, this, 0); - mySelectionMgr->clearFilters(); - //mySelectionMgr->clearSelected(); - if (SMESH::GetCurrentVtkView()) { - SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters - SMESH::SetPointRepresentation(false); - SMESH::SetPickable(); - } - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - mySMESHGUI->ResetState(); -} - -void SMESHGUI_ExtrusionDlg::reject() -{ - QDialog::reject(); - close(); -} - //================================================================================= // function : onSelectMesh() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h index 330951397..71d20ece0 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h @@ -68,12 +68,9 @@ public: SMESHGUI_ExtrusionDlg( SMESHGUI* ); ~SMESHGUI_ExtrusionDlg(); - void reject(); - private: void Init( bool = true ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void closeEvent( QCloseEvent* ); void keyPressEvent( QKeyEvent* ); int GetConstructorId(); void getExtrusionVector(SMESH::DirStruct& aVector); @@ -147,14 +144,14 @@ private: SMESHGUI_FilterDlg* myFilterDlg; protected slots: - virtual void onDisplaySimulation( bool ); + virtual void onDisplaySimulation( bool ); + virtual void reject(); private slots: void ConstructorsClicked( int ); void CheckIsEnable(); void ClickOnOk(); bool ClickOnApply(); - void ClickOnCancel(); void ClickOnHelp(); void ClickOnRadio(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 108f7bed5..f1097018a 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -2653,7 +2653,7 @@ QWidget* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myButtons[ BTN_Help ]); connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk())); - connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose())); + connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(reject())); connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply())); connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp())); @@ -2718,7 +2718,7 @@ void SMESHGUI_FilterDlg::Init (const QList& theTypes, const bool setInViewe mySMESHGUI->SetActiveDialogBox((QDialog*)this); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); updateMainButtons(); updateSelection(); @@ -2768,10 +2768,10 @@ void SMESHGUI_FilterDlg::onOk() } //======================================================================= -// name : SMESHGUI_FilterDlg::onClose +// name : SMESHGUI_FilterDlg::reject // Purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_FilterDlg::onClose() +void SMESHGUI_FilterDlg::reject() { // Restore previously selected object if (mySelectionMgr) @@ -2799,8 +2799,7 @@ void SMESHGUI_FilterDlg::onClose() disconnect(mySMESHGUI, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); - return; + QDialog::reject(); } //================================================================================= @@ -2848,15 +2847,6 @@ void SMESHGUI_FilterDlg::enterEvent (QEvent*) setEnabled(true); } -//======================================================================= -// name : closeEvent() -// Purpose : -//======================================================================= -void SMESHGUI_FilterDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - //======================================================================= // name : SMESHGUI_FilterDlg::getIdsFromWg // Purpose : Retrieve list of ids from given widget diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index 4501a9d37..8081aec69 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -238,11 +238,13 @@ signals: void Accepted(); +protected slots: + virtual void reject(); + private slots: void onOk(); bool onApply(); - void onClose(); void onHelp(); void onDeactivate(); void onSelectionDone(); @@ -253,7 +255,6 @@ private: void construct( const QList& ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index c17dde1fa..0a2ec7b66 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -269,7 +269,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myButtons[ BTN_Help ]); connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk())); - connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose())); + connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(reject())); connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply())); connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp())); @@ -337,7 +337,7 @@ void SMESHGUI_FilterLibraryDlg::Init (const QList& theTypes, setEnabled(true); connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); if (myMode == ADD_TO) { @@ -467,22 +467,18 @@ bool SMESHGUI_FilterLibraryDlg::onApply() void SMESHGUI_FilterLibraryDlg::onOk() { if (onApply()) - { - disconnect( mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - accept(); - } + reject(); } //======================================================================= -// name : SMESHGUI_FilterLibraryDlg::onClose +// name : SMESHGUI_FilterLibraryDlg::reject // Purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_FilterLibraryDlg::onClose() +void SMESHGUI_FilterLibraryDlg::reject() { disconnect( mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -527,15 +523,6 @@ void SMESHGUI_FilterLibraryDlg::enterEvent(QEvent*) setEnabled(true); } -//================================================================================= -// function : closeEvent() -// purpose : Close dialog -//================================================================================= -void SMESHGUI_FilterLibraryDlg::closeEvent(QCloseEvent* e) -{ - onClose(); -} - //======================================================================= // name : SMESHGUI_FilterLibraryDlg::getFileName // Purpose : Get file name diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h index 5b5af4fd0..539faab46 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h @@ -77,14 +77,15 @@ public: void SetTable( const SMESHGUI_FilterTable* ); private: - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); +protected slots: + virtual void reject(); + private slots: void onOk(); bool onApply(); - void onClose(); void onHelp(); void onDeactivate(); diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 03ebc2731..be401f774 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -439,7 +439,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create) connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK())); connect(myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply())); - connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(onClose())); + connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); connect(myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); /* Init selection */ @@ -458,7 +458,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create) myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged())); connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged())); @@ -1189,7 +1189,7 @@ void SMESHGUI_GroupDlg::onOK() { setIsApplyAndClose( true ); if ( onApply() ) - onClose(); + reject(); setIsApplyAndClose( false ); } @@ -2165,15 +2165,6 @@ void SMESHGUI_GroupDlg::onSort() } } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - //================================================================================= // function : onVisibilityChanged() // purpose : @@ -2184,10 +2175,10 @@ void SMESHGUI_GroupDlg::onVisibilityChanged() } //================================================================================= -// function : SMESHGUI_GroupDlg::onClose +// function : SMESHGUI_GroupDlg::reject // purpose : SLOT called when "Close" button pressed. Close dialog //================================================================================= -void SMESHGUI_GroupDlg::onClose() +void SMESHGUI_GroupDlg::reject() { if (SMESH::GetCurrentVtkView()) { SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters @@ -2208,7 +2199,7 @@ void SMESHGUI_GroupDlg::onClose() mySelectionMgr->clearFilters(); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -2262,16 +2253,6 @@ void SMESHGUI_GroupDlg::enterEvent (QEvent*) } } -//================================================================================= -// function : hideEvent -// purpose : caused by ESC key -//================================================================================= -void SMESHGUI_GroupDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized() && !myIsBusy) - onClose(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.h b/src/SMESHGUI/SMESHGUI_GroupDlg.h index f3cb58f0f..638699e19 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.h @@ -85,13 +85,15 @@ public slots: void onAdd(); void onRemove(); +protected slots: + virtual void reject(); + private slots: void onTypeChanged( int ); void onGrpTypeChanged( int ); void onColorChanged( QColor ); void onOK(); - void onClose(); bool onApply(); void onHelp(); void onDeactivate(); @@ -123,9 +125,7 @@ private: void init( SMESH::SMESH_Mesh_ptr ); void init( SMESH::SMESH_GroupBase_ptr, const bool theIsConvert = false ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); void setSelectionMode( int ); void updateButtons(); diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index 87b3ed7cd..2aeeea586 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -204,7 +204,7 @@ QWidget* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent) // connect signals and slots connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); @@ -228,7 +228,7 @@ void SMESHGUI_GroupOpDlg::Init() // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); // set selection mode if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) @@ -315,14 +315,14 @@ void SMESHGUI_GroupOpDlg::onOk() { setIsApplyAndClose( true ); if ( onApply() ) - onClose(); + reject(); setIsApplyAndClose( false ); } /*! - \brief SLOT called when "Close" button pressed closes dialog + \brief SLOT called when dialog is closed */ -void SMESHGUI_GroupOpDlg::onClose() +void SMESHGUI_GroupOpDlg::reject() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); @@ -331,7 +331,7 @@ void SMESHGUI_GroupOpDlg::onClose() mySMESHGUI->ResetState(); mySelectionMgr->clearFilters(); reset(); - reject(); + QDialog::reject(); } /*! @@ -467,14 +467,6 @@ void SMESHGUI_GroupOpDlg::enterEvent(QEvent*) mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP)); } -/*! - \brief Provides reaction on close event, closes the dialog box -*/ -void SMESHGUI_GroupOpDlg::closeEvent(QCloseEvent*) -{ - onClose(); -} - /*! \brief Resets state of the dialog, initializes its fields with default value, etc. Usually called by onApply() slot to reinitialize dialog fields. This virtual method diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h index ec3b4c2f5..bf4c2c473 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h @@ -92,13 +92,14 @@ protected: bool isApplyAndClose() const; private: - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); +protected slots: + virtual void reject(); + private slots: void onOk(); - void onClose(); void onHelp(); void onDeactivate(); diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index b1345a00a..82884701f 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -552,7 +552,7 @@ void SMESHGUI_MergeDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -571,7 +571,7 @@ void SMESHGUI_MergeDlg::Init() connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); // Init Mesh field from selection SelectionIntoArgument(); @@ -697,14 +697,14 @@ bool SMESHGUI_MergeDlg::ClickOnApply() void SMESHGUI_MergeDlg::ClickOnOk() { if (ClickOnApply()) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_MergeDlg::ClickOnCancel() +void SMESHGUI_MergeDlg::reject() { myIdPreview->SetPointsLabeled(false); SMESH::SetPointRepresentation(false); @@ -718,7 +718,7 @@ void SMESHGUI_MergeDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); - reject(); + QDialog::reject(); } //================================================================================= @@ -1226,26 +1226,6 @@ void SMESHGUI_MergeDlg::enterEvent(QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_MergeDlg::closeEvent(QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_MergeDlg::hideEvent (QHideEvent *) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.h b/src/SMESHGUI/SMESHGUI_MergeDlg.h index dd9458d61..9ec0dcb23 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.h +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.h @@ -78,9 +78,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); void onEditGroup(); @@ -150,9 +148,11 @@ private: QString myEntry; GrpList myGroups; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void updateControls(); diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index cfb1f0e64..48b0a82b9 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -352,7 +352,7 @@ QWidget* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent) aLay->addWidget(myHelpBtn); connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); @@ -390,7 +390,7 @@ void SMESHGUI_MeshPatternDlg::Init() // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); myTypeGrp->button(Type_2d)->setChecked(true); onTypeChanged(Type_2d); @@ -538,14 +538,14 @@ bool SMESHGUI_MeshPatternDlg::onApply() void SMESHGUI_MeshPatternDlg::onOk() { if (onApply()) - onClose(); + reject(); } //======================================================================= -// name : SMESHGUI_MeshPatternDlg::onClose +// name : SMESHGUI_MeshPatternDlg::reject // Purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_MeshPatternDlg::onClose() +void SMESHGUI_MeshPatternDlg::reject() { mySelectionMgr->clearFilters(); SMESH::SetPickable(); @@ -555,7 +555,7 @@ void SMESHGUI_MeshPatternDlg::onClose() disconnect(mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); erasePreview(); - reject(); + QDialog::reject(); } //================================================================================= @@ -724,15 +724,6 @@ void SMESHGUI_MeshPatternDlg::enterEvent (QEvent*) onTextChanged(mySelEdit[Ids]->text()); } -//======================================================================= -// name : SMESHGUI_MeshPatternDlg::closeEvent -// Purpose : -//======================================================================= -void SMESHGUI_MeshPatternDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - //======================================================================= // name : SMESHGUI_MeshPatternDlg::onSelInputChanged // Purpose : SLOT. Called when -> button clicked. diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h index 76e6aca77..ee1053f2a 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h @@ -75,10 +75,12 @@ public: void Init(); +protected slots: + virtual void reject(); + private slots: void onOk(); bool onApply(); - void onClose(); void onHelp(); void onDeactivate(); @@ -108,7 +110,6 @@ private: void activateSelection(); QStringList prepareFilters() const; QString autoExtension( const QString& ) const; - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); void keyPressEvent( QKeyEvent* ); bool isValid( const bool = true ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index b87346e63..1d3a35fc3 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -384,14 +384,14 @@ void SMESHGUI_MultiEditDlg::Init() // main buttons connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); // dialog controls connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() )); @@ -423,7 +423,7 @@ void SMESHGUI_MultiEditDlg::Init() void SMESHGUI_MultiEditDlg::onOk() { if (onApply()) - onClose(); + reject(); } //======================================================================= @@ -510,10 +510,10 @@ SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& o } //======================================================================= -// name : SMESHGUI_MultiEditDlg::onClose +// name : SMESHGUI_MultiEditDlg::reject // Purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_MultiEditDlg::onClose() +void SMESHGUI_MultiEditDlg::reject() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); @@ -527,7 +527,7 @@ void SMESHGUI_MultiEditDlg::onClose() //mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); - reject(); + QDialog::reject(); } //================================================================================= @@ -646,24 +646,6 @@ void SMESHGUI_MultiEditDlg::enterEvent (QEvent*) } } -//======================================================================= -// name : SMESHGUI_MultiEditDlg::closeEvent -// Purpose : -//======================================================================= -void SMESHGUI_MultiEditDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} -//======================================================================= -// name : SMESHGUI_MultiEditDlg::hideEvent -// Purpose : caused by ESC key -//======================================================================= -void SMESHGUI_MultiEditDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - onClose(); -} - //======================================================================= // name : SMESHGUI_MultiEditDlg::onFilterBtn // Purpose : SLOT. Called when "Filter" button pressed. @@ -1259,10 +1241,10 @@ SMESHGUI_CuttingOfQuadsDlg::~SMESHGUI_CuttingOfQuadsDlg() { } -void SMESHGUI_CuttingOfQuadsDlg::onClose() +void SMESHGUI_CuttingOfQuadsDlg::reject() { erasePreview(); - SMESHGUI_MultiEditDlg::onClose(); + SMESHGUI_MultiEditDlg::reject(); } bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index de9b0b67f..4c0aa432c 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -82,7 +82,7 @@ signals: protected slots: void onOk(); virtual bool onApply(); - virtual void onClose(); + virtual void reject(); void onHelp(); void onDeactivate(); @@ -102,9 +102,7 @@ protected slots: SMESH::NumericalFunctor_ptr getNumericalFunctor(); protected: - void closeEvent( QCloseEvent* ); void enterEvent( QEvent * ); - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); QWidget* createButtonFrame( QWidget* ); QWidget* createMainFrame( QWidget*, const bool ); @@ -221,7 +219,7 @@ protected: SMESH::SMESH_IDSource_ptr obj); protected slots: - virtual void onClose(); + virtual void reject(); void onCriterionRB(); void onPreviewChk(); diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index d82ec9c1d..e4010b893 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -370,7 +370,7 @@ void SMESHGUI_NodesDlg::Init() /* signals and slots connections */ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); - connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) ); + connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) ); @@ -381,8 +381,8 @@ void SMESHGUI_NodesDlg::Init() connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( SelectionIntoArgument() ) ); connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) ); /* to close dialog if study frame change */ - connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( ClickOnCancel() ) ); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnCancel())); + connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( reject() ) ); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); // set selection mode SMESH::SetPointRepresentation( true ); @@ -414,7 +414,7 @@ void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue ) void SMESHGUI_NodesDlg::ClickOnOk() { if ( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= @@ -539,10 +539,10 @@ bool SMESHGUI_NodesDlg::ClickOnApply() } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_NodesDlg::ClickOnCancel() +void SMESHGUI_NodesDlg::reject() { disconnect( mySelectionMgr, 0, this, 0 ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) @@ -552,7 +552,7 @@ void SMESHGUI_NodesDlg::ClickOnCancel() SMESH::SetPointRepresentation( false ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -638,25 +638,6 @@ void SMESHGUI_NodesDlg::SelectionIntoArgument() } } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_NodesDlg::closeEvent( QCloseEvent* ) -{ - this->ClickOnCancel(); /* same than click on cancel button */ -} - -//================================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//================================================================================= -void SMESHGUI_NodesDlg::hideEvent( QHideEvent* ) -{ - if ( !isMinimized() ) - ClickOnCancel(); -} - //================================================================================= // function : enterEvent() // purpose : to reactivate this dialog box when mouse enter onto the window diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.h b/src/SMESHGUI/SMESHGUI_NodesDlg.h index de2058f5a..7e4bca1ce 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.h @@ -79,8 +79,6 @@ private: void Init(); void enterEvent( QEvent* ); - void closeEvent( QCloseEvent* ); - void hideEvent ( QHideEvent* ); void keyPressEvent( QKeyEvent* ); bool isValid(); @@ -108,9 +106,11 @@ private: QString myHelpFileName; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void DeactivateActiveDialog(); diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx index 4e3f3d5b5..bdb954b6b 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx @@ -435,7 +435,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* // Connect section connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) ); connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) ); - connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( onCancel() ) ); + connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( myHelpBtn, SIGNAL(clicked()), this, SLOT( onHelp() ) ); connect( myMinEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) ); connect( myMaxEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) ); @@ -445,7 +445,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* connect( myDistributionGrp, SIGNAL( toggled(bool) ), this, SLOT(onDistributionActivated(bool)) ); connect( myDistribColorGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onDistributionChanged( int ) ) ); connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) ); - connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onCancel() ) ); + connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) ); myHelpFileName = "quality_page.html"; } @@ -471,7 +471,7 @@ SMESHGUI_Preferences_ScalarBarDlg::~SMESHGUI_Preferences_ScalarBarDlg() void SMESHGUI_Preferences_ScalarBarDlg::onOk() { if ( onApply() ) - onCancel(); + reject(); } //================================================================================================= @@ -588,14 +588,15 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply() //================================================================================================= /*! - * SMESHGUI_Preferences_ScalarBarDlg::onCancel + * SMESHGUI_Preferences_ScalarBarDlg::reject * * Cancel button slot */ //================================================================================================= -void SMESHGUI_Preferences_ScalarBarDlg::onCancel() +void SMESHGUI_Preferences_ScalarBarDlg::reject() { - close(); + myDlg = 0; + QDialog::reject(); } //================================================================================================= @@ -724,19 +725,6 @@ void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged() myDistributionGrp->setEnabled( false ); } -//================================================================================================= -/*! - * SMESHGUI_Preferences_ScalarBarDlg::closeEvent - * - * Close event handler - */ -//================================================================================================= -void SMESHGUI_Preferences_ScalarBarDlg::closeEvent( QCloseEvent* e ) -{ - myDlg = 0; - QDialog::closeEvent( e ); -} - //================================================================================================= /*! * SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h index 05dea0f59..6b3196e4c 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h @@ -64,17 +64,18 @@ public: static void ScalarBarProperties( SMESHGUI* ); - void closeEvent( QCloseEvent* ); void setOriginAndSize( const double, const double, const double, const double ); void initScalarBarFromResources(); +protected slots: + virtual void reject(); + protected slots: void onOk(); bool onApply(); - void onCancel(); void onHelp(); void onSelectionChanged(); void onXYChanged(); diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 6a5cedd86..4bccb68c4 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -196,7 +196,7 @@ void SMESHGUI_RemoveElementsDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init() connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); @@ -257,14 +257,14 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply() void SMESHGUI_RemoveElementsDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_RemoveElementsDlg::ClickOnCancel() +void SMESHGUI_RemoveElementsDlg::reject() { if (SMESH::GetCurrentVtkView()) SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters @@ -274,7 +274,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnCancel() disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -457,26 +457,6 @@ void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_RemoveElementsDlg::closeEvent(QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_RemoveElementsDlg::hideEvent( QHideEvent* ) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h index 6cc8d5ae4..5c179e7ed 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h @@ -63,9 +63,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); LightApp_SelectionMgr* mySelectionMgr; @@ -96,9 +94,11 @@ private: SMESHGUI_FilterDlg* myFilterDlg; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index 303aee6f6..19103ebca 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -196,7 +196,7 @@ void SMESHGUI_RemoveNodesDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init() connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); @@ -261,14 +261,14 @@ void SMESHGUI_RemoveNodesDlg::ClickOnApply() void SMESHGUI_RemoveNodesDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_RemoveNodesDlg::ClickOnCancel() +void SMESHGUI_RemoveNodesDlg::reject() { //mySelectionMgr->clearSelected(); if (SMESH::GetCurrentVtkView()) { @@ -280,7 +280,7 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel() disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -463,26 +463,6 @@ void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_RemoveNodesDlg::closeEvent(QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_RemoveNodesDlg::hideEvent( QHideEvent* ) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h index 75a7afed3..77a2378f1 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h @@ -63,9 +63,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); LightApp_SelectionMgr* mySelectionMgr; @@ -96,9 +94,11 @@ private: SMESHGUI_FilterDlg* myFilterDlg; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx index 96d061cc6..923688cdd 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx @@ -186,7 +186,7 @@ void SMESHGUI_RenumberingDlg::Init() /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -194,7 +194,7 @@ void SMESHGUI_RenumberingDlg::Init() connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); myEditCurrentArgument = LineEditMesh; LineEditMesh->setFocus(); @@ -254,20 +254,20 @@ void SMESHGUI_RenumberingDlg::ClickOnApply() void SMESHGUI_RenumberingDlg::ClickOnOk() { ClickOnApply(); - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_RenumberingDlg::ClickOnCancel() +void SMESHGUI_RenumberingDlg::reject() { //mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -392,26 +392,6 @@ void SMESHGUI_RenumberingDlg::enterEvent(QEvent* e) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_RenumberingDlg::closeEvent(QCloseEvent* e) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_RenumberingDlg::hideEvent (QHideEvent * e) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : keyPressEvent() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.h b/src/SMESHGUI/SMESHGUI_RenumberingDlg.h index 5ebbe6ca3..bb0a9232b 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.h +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.h @@ -60,9 +60,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ @@ -89,9 +87,11 @@ private: QString myHelpFileName; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); void ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index f85e4eade..6baa81109 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -323,7 +323,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); @@ -343,7 +343,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule ) connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); @@ -574,21 +574,27 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply() void SMESHGUI_RevolutionDlg::ClickOnOk() { if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_RevolutionDlg::ClickOnCancel() -{ - reject(); -} - void SMESHGUI_RevolutionDlg::reject() { - close(); + disconnect(mySelectionMgr, 0, this, 0); + mySelectionMgr->clearFilters(); + //mySelectionMgr->clearSelected(); + if (SMESH::GetCurrentVtkView()) { + SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters + SMESH::SetPointRepresentation(false); + } + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + mySMESHGUI->ResetState(); + + QDialog::reject(); } //================================================================================= @@ -910,25 +916,6 @@ void SMESHGUI_RevolutionDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - disconnect(mySelectionMgr, 0, this, 0); - mySelectionMgr->clearFilters(); - //mySelectionMgr->clearSelected(); - if (SMESH::GetCurrentVtkView()) { - SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters - SMESH::SetPointRepresentation(false); - } - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - mySMESHGUI->ResetState(); -} - //======================================================================= //function : onSelectMesh //purpose : diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h index 91d1e4268..cfb9e1fc9 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h @@ -74,13 +74,10 @@ public: SMESHGUI_RevolutionDlg( SMESHGUI* ); ~SMESHGUI_RevolutionDlg(); - void reject(); - private: enum {NONE_SELECT, POINT_SELECT, FACE_SELECT}; void Init( bool = true); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); @@ -163,11 +160,11 @@ private: protected slots: virtual void onDisplaySimulation( bool ); + virtual void reject(); private slots: void ConstructorsClicked( int ); void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 0e0690c01..e737712df 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -297,7 +297,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) : /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -312,7 +312,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) : connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); @@ -508,14 +508,14 @@ void SMESHGUI_RotationDlg::ClickOnOk() { setIsApplyAndClose( true ); if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_RotationDlg::ClickOnCancel() +void SMESHGUI_RotationDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); @@ -527,7 +527,7 @@ void SMESHGUI_RotationDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -857,26 +857,6 @@ void SMESHGUI_RotationDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_RotationDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//================================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//================================================================================= -void SMESHGUI_RotationDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : onSelectMesh() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.h b/src/SMESHGUI/SMESHGUI_RotationDlg.h index a4e6b4af2..e52f59c12 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.h +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.h @@ -66,9 +66,7 @@ public: private: void Init( bool = true ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); bool IsAxisOk(); void setNewMeshName(); @@ -134,11 +132,11 @@ private: SMESHGUI_FilterDlg* myFilterDlg; protected slots: - virtual void onDisplaySimulation( bool ); + virtual void onDisplaySimulation( bool ); + virtual void reject(); private slots: void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index b74a31f12..8dd25d87c 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -301,7 +301,7 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) : /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); @@ -312,7 +312,7 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) : connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); @@ -545,14 +545,14 @@ void SMESHGUI_ScaleDlg::ClickOnOk() { setIsApplyAndClose( true ); if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_ScaleDlg::ClickOnCancel() +void SMESHGUI_ScaleDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); @@ -564,7 +564,7 @@ void SMESHGUI_ScaleDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode( ActorSelection ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -881,26 +881,6 @@ void SMESHGUI_ScaleDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_ScaleDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_ScaleDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //======================================================================= //function : onSelectMesh //purpose : diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.h b/src/SMESHGUI/SMESHGUI_ScaleDlg.h index 7293a99e7..55bf4acc6 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.h +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.h @@ -62,9 +62,7 @@ public: private: void Init( bool = true ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); void setNewMeshName(); @@ -129,12 +127,12 @@ private: protected slots: - virtual void onDisplaySimulation( bool ); + virtual void onDisplaySimulation( bool ); + virtual void reject(); private slots: void ConstructorsClicked( int ); void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index 24d85f012..60ee92301 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -257,7 +257,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule ) /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); @@ -272,7 +272,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule ) connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); @@ -548,14 +548,14 @@ bool SMESHGUI_SewingDlg::ClickOnApply() void SMESHGUI_SewingDlg::ClickOnOk() { if (ClickOnApply()) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_SewingDlg::ClickOnCancel() +void SMESHGUI_SewingDlg::reject() { //mySelectionMgr->clearSelected(); SMESH::SetPointRepresentation(false); @@ -563,7 +563,7 @@ void SMESHGUI_SewingDlg::ClickOnCancel() aViewWindow->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -873,26 +873,6 @@ void SMESHGUI_SewingDlg::enterEvent (QEvent* e) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_SewingDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_SewingDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //================================================================================= // function : GetConstructorId() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.h b/src/SMESHGUI/SMESHGUI_SewingDlg.h index f8ff617d0..3d9402714 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.h @@ -63,9 +63,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); bool IsValid(); @@ -118,10 +116,12 @@ private: QString myHelpFileName; +protected slots: + virtual void reject(); + private slots: void ConstructorsClicked( int ); void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index f93ce9556..ef9bf0014 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -215,14 +215,14 @@ void SMESHGUI_SingleEditDlg::Init() // main buttons connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject())); connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject())); connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); myOkBtn->setEnabled(false); @@ -244,14 +244,14 @@ void SMESHGUI_SingleEditDlg::Init() void SMESHGUI_SingleEditDlg::onOk() { if (onApply()) - onClose(); + reject(); } //======================================================================= -// name : onClose() +// name : reject() // Purpose : SLOT called when "Close" button pressed. Close dialog //======================================================================= -void SMESHGUI_SingleEditDlg::onClose() +void SMESHGUI_SingleEditDlg::reject() { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); @@ -259,7 +259,7 @@ void SMESHGUI_SingleEditDlg::onClose() disconnect(mySelectionMgr, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -458,25 +458,6 @@ void SMESHGUI_SingleEditDlg::enterEvent (QEvent*) } } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_SingleEditDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - -//======================================================================= -//function : hideEvent() -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_SingleEditDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - onClose(); -} - //================================================================================= // function : onApply() // purpose : SLOT. Called when apply button is pressed diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h index cc04610ac..bf88ec684 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h @@ -62,7 +62,7 @@ public: protected slots: void onOk(); virtual bool onApply(); - void onClose(); + virtual void reject(); void onHelp(); void onDeactivate(); @@ -71,9 +71,7 @@ protected slots: void onTextChange( const QString& ); protected: - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); QWidget* createButtonFrame( QWidget* ); QWidget* createMainFrame( QWidget* ); diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 61aaae845..e31d5c79b 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -275,7 +275,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) /***************************************************************/ // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); @@ -284,7 +284,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule ) connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEditNodes, SIGNAL(textChanged(const QString&)), @@ -421,14 +421,14 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() void SMESHGUI_SmoothingDlg::ClickOnOk() { if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : Called when dialog box is closed //================================================================================= -void SMESHGUI_SmoothingDlg::ClickOnCancel() +void SMESHGUI_SmoothingDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); @@ -441,7 +441,7 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -704,26 +704,6 @@ void SMESHGUI_SmoothingDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_SmoothingDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//======================================================================= -void SMESHGUI_SmoothingDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //======================================================================= // function : onSelectMesh() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h index efb9723a6..78c4b2a6b 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h @@ -71,9 +71,7 @@ public: private: void Init(); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); void setFilters( const bool theIsElem ); @@ -124,9 +122,11 @@ private: QPushButton* myElemFilterBtn; SMESHGUI_FilterDlg* myFilterDlg; +protected slots: + virtual void reject(); + private slots: void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 5ab4f3f22..532e327ce 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -300,7 +300,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); @@ -316,7 +316,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule ) connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); @@ -573,14 +573,14 @@ void SMESHGUI_SymmetryDlg::ClickOnOk() { setIsApplyAndClose( true ); if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_SymmetryDlg::ClickOnCancel() +void SMESHGUI_SymmetryDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); @@ -592,7 +592,7 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -917,26 +917,6 @@ void SMESHGUI_SymmetryDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_SymmetryDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -// function : hideEvent() -// purpose : caused by ESC key -//======================================================================= -void SMESHGUI_SymmetryDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //======================================================================= //function : onSelectMesh //purpose : diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h index a039ac27f..660d946fe 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h @@ -66,9 +66,7 @@ public: private: void Init( bool = true ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); bool IsMirrorOk(); @@ -139,11 +137,11 @@ private: protected slots: virtual void onDisplaySimulation( bool ); + virtual void reject(); private slots: void ConstructorsClicked( int ); void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument(); diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index eaee51409..08305f678 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -304,7 +304,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) : /* signals and slots connections */ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); @@ -316,7 +316,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) : connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); /* to close dialog if study change */ - connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); + connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject())); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); @@ -578,14 +578,14 @@ void SMESHGUI_TranslationDlg::ClickOnOk() { setIsApplyAndClose( true ); if( ClickOnApply() ) - ClickOnCancel(); + reject(); } //================================================================================= -// function : ClickOnCancel() +// function : reject() // purpose : //================================================================================= -void SMESHGUI_TranslationDlg::ClickOnCancel() +void SMESHGUI_TranslationDlg::reject() { disconnect(mySelectionMgr, 0, this, 0); mySelectionMgr->clearFilters(); @@ -597,7 +597,7 @@ void SMESHGUI_TranslationDlg::ClickOnCancel() if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode( ActorSelection ); mySMESHGUI->ResetState(); - reject(); + QDialog::reject(); } //================================================================================= @@ -883,26 +883,6 @@ void SMESHGUI_TranslationDlg::enterEvent (QEvent*) ActivateThisDialog(); } -//================================================================================= -// function : closeEvent() -// purpose : -//================================================================================= -void SMESHGUI_TranslationDlg::closeEvent (QCloseEvent*) -{ - /* same than click on cancel button */ - ClickOnCancel(); -} - -//======================================================================= -//function : hideEvent -//purpose : caused by ESC key -//======================================================================= -void SMESHGUI_TranslationDlg::hideEvent (QHideEvent*) -{ - if (!isMinimized()) - ClickOnCancel(); -} - //======================================================================= //function : onSelectMesh //purpose : diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.h b/src/SMESHGUI/SMESHGUI_TranslationDlg.h index 2c7294378..61a86afee 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.h +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.h @@ -65,9 +65,7 @@ public: private: void Init( bool = true ); - void closeEvent( QCloseEvent* ); void enterEvent( QEvent* ); /* mouse enter the QWidget */ - void hideEvent( QHideEvent* ); /* ESC key */ void keyPressEvent( QKeyEvent* ); int GetConstructorId(); void setNewMeshName(); @@ -132,12 +130,12 @@ private: SMESHGUI_FilterDlg* myFilterDlg; protected slots: - virtual void onDisplaySimulation( bool ); + virtual void onDisplaySimulation( bool ); + virtual void reject(); private slots: void ConstructorsClicked( int ); void ClickOnOk(); - void ClickOnCancel(); bool ClickOnApply(); void ClickOnHelp(); void SetEditCurrentArgument();