0022123: EDF 2558 SMESH: Group creation crashs with the filter "Free faces":

using reject() slot instead of closeEvent() and hideEvent().
This commit is contained in:
akl 2013-02-21 12:10:00 +00:00
parent 469f938766
commit 2770bdc924
60 changed files with 284 additions and 779 deletions

View File

@ -441,7 +441,7 @@ void SMESHGUI_AddMeshElementDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp()));
@ -450,8 +450,8 @@ void SMESHGUI_AddMeshElementDlg::Init()
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
/* to close dialog if study frame change */ /* to close dialog if study frame change */
connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
if (Reverse) if (Reverse)
connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int))); connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int)));
@ -599,14 +599,14 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
void SMESHGUI_AddMeshElementDlg::ClickOnOk() void SMESHGUI_AddMeshElementDlg::ClickOnOk()
{ {
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_AddMeshElementDlg::ClickOnCancel() void SMESHGUI_AddMeshElementDlg::reject()
{ {
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
mySimulation->SetVisibility(false); mySimulation->SetVisibility(false);
@ -615,7 +615,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -874,26 +874,6 @@ void SMESHGUI_AddMeshElementDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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() // function : CheckBox()
// purpose : // purpose :

View File

@ -71,8 +71,6 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void hideEvent( QHideEvent* ); /* ESC key */
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
void displaySimulation(); void displaySimulation();
@ -119,9 +117,11 @@ private:
QString myHelpFileName; QString myHelpFileName;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -628,13 +628,13 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
connect(myReverseCB, SIGNAL(stateChanged(int)), SLOT(onReverse(int))); connect(myReverseCB, SIGNAL(stateChanged(int)), SLOT(onReverse(int)));
connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject()));
myCurrentLineEdit = myCornerNodes; myCurrentLineEdit = myCornerNodes;
@ -803,14 +803,14 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
void SMESHGUI_AddQuadraticElementDlg::ClickOnOk() void SMESHGUI_AddQuadraticElementDlg::ClickOnOk()
{ {
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel() void SMESHGUI_AddQuadraticElementDlg::reject()
{ {
mySelectionMgr->clearSelected(); mySelectionMgr->clearSelected();
mySimulation->SetVisibility(false); mySimulation->SetVisibility(false);
@ -819,7 +819,7 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel()
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -1134,26 +1134,6 @@ void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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() // function : onReverse()
// purpose : // purpose :

View File

@ -73,8 +73,6 @@ private:
typedef QList<SMESH::SMESH_GroupBase_var> GrpList; typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
void Init(); void Init();
void closeEvent( QCloseEvent* );
void hideEvent( QHideEvent* ); /* ESC key */
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
void displaySimulation(); void displaySimulation();
@ -128,6 +126,9 @@ private:
QString myHelpFileName; QString myHelpFileName;
protected slots:
virtual void reject();
private slots: private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void onCellTextChange( int, int ); void onCellTextChange( int, int );
@ -135,7 +136,6 @@ private slots:
void onCellDoubleClicked( int, int ); void onCellDoubleClicked( int, int );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetCurrentSelection(); void SetCurrentSelection();

View File

@ -212,7 +212,7 @@ void SMESHGUI_BuildCompoundDlg::Init()
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
@ -223,7 +223,7 @@ void SMESHGUI_BuildCompoundDlg::Init()
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); 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"))); LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH")));
LineEditMeshes->setFocus(); LineEditMeshes->setFocus();
@ -366,20 +366,20 @@ void SMESHGUI_BuildCompoundDlg::ClickOnOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if (ClickOnApply()) if (ClickOnApply())
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_BuildCompoundDlg::ClickOnCancel() void SMESHGUI_BuildCompoundDlg::reject()
{ {
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -480,27 +480,6 @@ void SMESHGUI_BuildCompoundDlg::enterEvent( QEvent* )
ActivateThisDialog(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -68,9 +68,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
bool isValid(); bool isValid();
@ -115,9 +113,11 @@ private:
bool myIsApplyAndClose; bool myIsApplyAndClose;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SelectionIntoArgument(); void SelectionIntoArgument();

View File

@ -479,12 +479,12 @@ SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule, SVTK_ViewWindow
connect(PreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(OnPreviewToggle(bool))); connect(PreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(OnPreviewToggle(bool)));
connect(AutoApplyCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAutoApply(bool))); connect(AutoApplyCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAutoApply(bool)));
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); 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 */ /* to close dialog if study frame change */
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(reject()));
this->show(); this->show();
} }
@ -589,16 +589,17 @@ void SMESHGUI_ClippingDlg::ClickOnApply()
void SMESHGUI_ClippingDlg::ClickOnOk() void SMESHGUI_ClippingDlg::ClickOnOk()
{ {
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//======================================================================= //=======================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//======================================================================= //=======================================================================
void SMESHGUI_ClippingDlg::ClickOnCancel() void SMESHGUI_ClippingDlg::reject()
{ {
close(); //here we can insert actions to do at close.
QDialog::reject();
} }
//================================================================================= //=================================================================================

View File

@ -192,6 +192,9 @@ private:
bool myIsSelectPlane; bool myIsSelectPlane;
QString myHelpFileName; QString myHelpFileName;
protected slots:
virtual void reject();
public slots: public slots:
void onSelectPlane( int ); void onSelectPlane( int );
void ClickOnNew(); void ClickOnNew();
@ -203,7 +206,6 @@ public slots:
void OnPreviewToggle( bool ); void OnPreviewToggle( bool );
void onAutoApply(bool); void onAutoApply(bool);
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
}; };

View File

@ -227,7 +227,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
@ -236,7 +236,7 @@ SMESHGUI_CopyMeshDlg::SMESHGUI_CopyMeshDlg( SMESHGUI* theModule )
connect(mySelectionMgr, SIGNAL (currentSelectionChanged()), connect(mySelectionMgr, SIGNAL (currentSelectionChanged()),
this, SLOT (SelectionIntoArgument())); this, SLOT (SelectionIntoArgument()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
this, SLOT (ClickOnCancel())); this, SLOT (reject()));
connect(myLineEditElements, SIGNAL(textChanged(const QString&)), connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
this, SLOT (onTextChange(const QString&))); this, SLOT (onTextChange(const QString&)));
@ -369,14 +369,14 @@ void SMESHGUI_CopyMeshDlg::ClickOnOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_CopyMeshDlg::ClickOnCancel() void SMESHGUI_CopyMeshDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
if ( mySelectionMgr ) if ( mySelectionMgr )
@ -384,7 +384,7 @@ void SMESHGUI_CopyMeshDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -618,26 +618,6 @@ void SMESHGUI_CopyMeshDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -65,9 +65,7 @@ public:
private: private:
void Init( bool = true ); void Init( bool = true );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
void setNewMeshName(); void setNewMeshName();
@ -114,9 +112,11 @@ private:
bool myIsApplyAndClose; bool myIsApplyAndClose;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SelectionIntoArgument(); void SelectionIntoArgument();

View File

@ -230,7 +230,7 @@ QWidget* SMESHGUI_CreatePatternDlg::createButtonFrame( QWidget* theParent )
aLay->addWidget( myHelpBtn ); aLay->addWidget( myHelpBtn );
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) ); 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( mySaveBtn, SIGNAL( clicked() ), this, SLOT( onSave() ) );
connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
@ -279,7 +279,7 @@ void SMESHGUI_CreatePatternDlg::Init( const int theType )
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
this, SLOT( onDeactivate() ) ); this, SLOT( onDeactivate() ) );
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
this, SLOT( onClose() ) ); this, SLOT( reject() ) );
mySwitch2d->setEnabled( theType == Type_2d ); mySwitch2d->setEnabled( theType == Type_2d );
mySwitch3d->setEnabled( theType == Type_3d ); 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 // purpose : SLOT called when "Close" button pressed. Close dialog
//======================================================================= //=======================================================================
void SMESHGUI_CreatePatternDlg::onClose() void SMESHGUI_CreatePatternDlg::reject()
{ {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySelectionMgr, 0, this, 0 );
disconnect( mySMESHGUI, 0, this, 0 ); disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
emit Close(); 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() // function : onSelBtnClicked()
// purpose : SLOT. Called when -> button clicked. // purpose : SLOT. Called when -> button clicked.

View File

@ -74,14 +74,13 @@ signals:
void Close(); void Close();
private: private:
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
private slots: private slots:
void onOk(); void onOk();
void onSave(); void onSave();
void onClose(); void reject();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();

View File

@ -335,7 +335,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) ); 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(buttonApply, SIGNAL( clicked() ), SLOT( ClickOnApply() ) );
connect(buttonHelp, SIGNAL( clicked() ), SLOT( ClickOnHelp() ) ); connect(buttonHelp, SIGNAL( clicked() ), SLOT( ClickOnHelp() ) );
@ -351,7 +351,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool))); connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
/* to close dialog if study change */ /* to close dialog if study change */
connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
ConstructorsClicked(0); ConstructorsClicked(0);
SelectionIntoArgument(); SelectionIntoArgument();
@ -589,15 +589,15 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk()
{ {
if(checkEditLine(false) == -1) {return;} if(checkEditLine(false) == -1) {return;}
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel() void SMESHGUI_CreatePolyhedralVolumeDlg::reject()
{ {
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
//SALOME_ListIO aList; //SALOME_ListIO aList;
@ -608,7 +608,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySelectionMgr, 0, this, 0 );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -1037,30 +1037,6 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e)
ActivateThisDialog(); 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() // function : GetConstructorId()
// purpose : // purpose :

View File

@ -72,9 +72,7 @@ private:
typedef QList<SMESH::SMESH_GroupBase_var> GrpList; typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
void displaySimulation(); void displaySimulation();
@ -125,11 +123,13 @@ public slots:
void onAdd(); void onAdd();
void onRemove(); void onRemove();
protected slots:
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnPreview( bool ); void ClickOnPreview( bool );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -146,7 +146,7 @@ QWidget* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent)
// connect signals and slots // connect signals and slots
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); 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(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
@ -173,7 +173,7 @@ void SMESHGUI_DeleteGroupDlg::Init ()
// selection and SMESHGUI // selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// set selection mode // set selection mode
mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::GROUP));
@ -239,14 +239,14 @@ bool SMESHGUI_DeleteGroupDlg::onApply()
void SMESHGUI_DeleteGroupDlg::onOk() void SMESHGUI_DeleteGroupDlg::onOk()
{ {
if (onApply()) if (onApply())
onClose(); reject();
} }
//================================================================================= //=================================================================================
// function : onClose() // function : reject()
// purpose : SLOT called when "Close" button pressed. Close dialog // purpose : SLOT called when "Close" button pressed. Close dialog
//================================================================================= //=================================================================================
void SMESHGUI_DeleteGroupDlg::onClose() void SMESHGUI_DeleteGroupDlg::reject()
{ {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
@ -254,7 +254,7 @@ void SMESHGUI_DeleteGroupDlg::onClose()
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -334,15 +334,6 @@ void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*)
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP)); mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
} }
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void SMESHGUI_DeleteGroupDlg::closeEvent (QCloseEvent*)
{
onClose();
}
//================================================================================= //=================================================================================
// function : keyPressEvent() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -59,14 +59,15 @@ public:
void Init (); void Init ();
private: private:
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
protected slots:
virtual void reject();
private slots: private slots:
void onOk(); void onOk();
bool onApply(); bool onApply();
void onClose();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();

View File

@ -214,14 +214,14 @@ SMESHGUI_DuplicateNodesDlg::SMESHGUI_DuplicateNodesDlg( SMESHGUI* theModule )
connect(mySelectButton3, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument())); connect(mySelectButton3, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument()));
connect(myButtonOk, SIGNAL(clicked()), this, SLOT(onOk())); 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(myButtonApply, SIGNAL(clicked()), this, SLOT(onApply()));
connect(myButtonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); connect(myButtonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionChanged())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionChanged()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); 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() void SMESHGUI_DuplicateNodesDlg::onOk()
{ {
if (onApply()) if (onApply())
onClose(); reject();
} }
/*! /*!
\brief SLOT called to close the dialog. \brief SLOT called to close the dialog.
*/ */
void SMESHGUI_DuplicateNodesDlg::onClose() void SMESHGUI_DuplicateNodesDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
mySelectionMgr->clearFilters(); 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. \brief Receive key press events.
Reimplemented from QWidget class. Reimplemented from QWidget class.

View File

@ -65,15 +65,16 @@ private:
bool isValid(); bool isValid();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
protected slots:
virtual void reject();
private slots: private slots:
void onConstructorsClicked( int ); void onConstructorsClicked( int );
void onOk(); void onOk();
void onClose();
bool onApply(); bool onApply();
void onHelp(); void onHelp();

View File

@ -305,7 +305,7 @@ SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
/***************************************************************/ /***************************************************************/
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); 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(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
@ -664,16 +664,28 @@ bool SMESHGUI_ExtrusionDlg::ClickOnApply()
void SMESHGUI_ExtrusionDlg::ClickOnOk() void SMESHGUI_ExtrusionDlg::ClickOnOk()
{ {
if (ClickOnApply()) if (ClickOnApply())
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : Called when dialog box is closed // 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(); 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() // function : onSelectMesh()
// purpose : // purpose :

View File

@ -68,12 +68,9 @@ public:
SMESHGUI_ExtrusionDlg( SMESHGUI* ); SMESHGUI_ExtrusionDlg( SMESHGUI* );
~SMESHGUI_ExtrusionDlg(); ~SMESHGUI_ExtrusionDlg();
void reject();
private: private:
void Init( bool = true ); void Init( bool = true );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
void getExtrusionVector(SMESH::DirStruct& aVector); void getExtrusionVector(SMESH::DirStruct& aVector);
@ -148,13 +145,13 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void CheckIsEnable(); void CheckIsEnable();
void ClickOnOk(); void ClickOnOk();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnCancel();
void ClickOnHelp(); void ClickOnHelp();
void ClickOnRadio(); void ClickOnRadio();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -2653,7 +2653,7 @@ QWidget* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent)
aLay->addWidget(myButtons[ BTN_Help ]); aLay->addWidget(myButtons[ BTN_Help ]);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk())); 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_Apply ], SIGNAL(clicked()), SLOT(onApply()));
connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp())); connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
@ -2718,7 +2718,7 @@ void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes, const bool setInViewe
mySMESHGUI->SetActiveDialogBox((QDialog*)this); mySMESHGUI->SetActiveDialogBox((QDialog*)this);
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
updateMainButtons(); updateMainButtons();
updateSelection(); 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 // Purpose : SLOT called when "Close" button pressed. Close dialog
//======================================================================= //=======================================================================
void SMESHGUI_FilterDlg::onClose() void SMESHGUI_FilterDlg::reject()
{ {
// Restore previously selected object // Restore previously selected object
if (mySelectionMgr) if (mySelectionMgr)
@ -2799,8 +2799,7 @@ void SMESHGUI_FilterDlg::onClose()
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
return;
} }
//================================================================================= //=================================================================================
@ -2848,15 +2847,6 @@ void SMESHGUI_FilterDlg::enterEvent (QEvent*)
setEnabled(true); setEnabled(true);
} }
//=======================================================================
// name : closeEvent()
// Purpose :
//=======================================================================
void SMESHGUI_FilterDlg::closeEvent (QCloseEvent*)
{
onClose();
}
//======================================================================= //=======================================================================
// name : SMESHGUI_FilterDlg::getIdsFromWg // name : SMESHGUI_FilterDlg::getIdsFromWg
// Purpose : Retrieve list of ids from given widget // Purpose : Retrieve list of ids from given widget

View File

@ -238,11 +238,13 @@ signals:
void Accepted(); void Accepted();
protected slots:
virtual void reject();
private slots: private slots:
void onOk(); void onOk();
bool onApply(); bool onApply();
void onClose();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
void onSelectionDone(); void onSelectionDone();
@ -253,7 +255,6 @@ private:
void construct( const QList<int>& ); void construct( const QList<int>& );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );

View File

@ -269,7 +269,7 @@ QWidget* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent)
aLay->addWidget(myButtons[ BTN_Help ]); aLay->addWidget(myButtons[ BTN_Help ]);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk())); 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_Apply ], SIGNAL(clicked()), SLOT(onApply()));
connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp())); connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
@ -337,7 +337,7 @@ void SMESHGUI_FilterLibraryDlg::Init (const QList<int>& theTypes,
setEnabled(true); setEnabled(true);
connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
if (myMode == ADD_TO) if (myMode == ADD_TO)
{ {
@ -467,22 +467,18 @@ bool SMESHGUI_FilterLibraryDlg::onApply()
void SMESHGUI_FilterLibraryDlg::onOk() void SMESHGUI_FilterLibraryDlg::onOk()
{ {
if (onApply()) if (onApply())
{ reject();
disconnect( mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
accept();
}
} }
//======================================================================= //=======================================================================
// name : SMESHGUI_FilterLibraryDlg::onClose // name : SMESHGUI_FilterLibraryDlg::reject
// Purpose : SLOT called when "Close" button pressed. Close dialog // Purpose : SLOT called when "Close" button pressed. Close dialog
//======================================================================= //=======================================================================
void SMESHGUI_FilterLibraryDlg::onClose() void SMESHGUI_FilterLibraryDlg::reject()
{ {
disconnect( mySMESHGUI, 0, this, 0); disconnect( mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -527,15 +523,6 @@ void SMESHGUI_FilterLibraryDlg::enterEvent(QEvent*)
setEnabled(true); setEnabled(true);
} }
//=================================================================================
// function : closeEvent()
// purpose : Close dialog
//=================================================================================
void SMESHGUI_FilterLibraryDlg::closeEvent(QCloseEvent* e)
{
onClose();
}
//======================================================================= //=======================================================================
// name : SMESHGUI_FilterLibraryDlg::getFileName // name : SMESHGUI_FilterLibraryDlg::getFileName
// Purpose : Get file name // Purpose : Get file name

View File

@ -77,14 +77,15 @@ public:
void SetTable( const SMESHGUI_FilterTable* ); void SetTable( const SMESHGUI_FilterTable* );
private: private:
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
protected slots:
virtual void reject();
private slots: private slots:
void onOk(); void onOk();
bool onApply(); bool onApply();
void onClose();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();

View File

@ -439,7 +439,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK())); connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
connect(myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply())); 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())); connect(myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
/* Init selection */ /* Init selection */
@ -458,7 +458,7 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); 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(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged())); connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged()));
@ -1189,7 +1189,7 @@ void SMESHGUI_GroupDlg::onOK()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if ( onApply() ) if ( onApply() )
onClose(); reject();
setIsApplyAndClose( false ); setIsApplyAndClose( false );
} }
@ -2165,15 +2165,6 @@ void SMESHGUI_GroupDlg::onSort()
} }
} }
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
{
onClose();
}
//================================================================================= //=================================================================================
// function : onVisibilityChanged() // function : onVisibilityChanged()
// purpose : // 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 // purpose : SLOT called when "Close" button pressed. Close dialog
//================================================================================= //=================================================================================
void SMESHGUI_GroupDlg::onClose() void SMESHGUI_GroupDlg::reject()
{ {
if (SMESH::GetCurrentVtkView()) { if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
@ -2208,7 +2199,7 @@ void SMESHGUI_GroupDlg::onClose()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySMESHGUI->ResetState(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -85,13 +85,15 @@ public slots:
void onAdd(); void onAdd();
void onRemove(); void onRemove();
protected slots:
virtual void reject();
private slots: private slots:
void onTypeChanged( int ); void onTypeChanged( int );
void onGrpTypeChanged( int ); void onGrpTypeChanged( int );
void onColorChanged( QColor ); void onColorChanged( QColor );
void onOK(); void onOK();
void onClose();
bool onApply(); bool onApply();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
@ -123,9 +125,7 @@ private:
void init( SMESH::SMESH_Mesh_ptr ); void init( SMESH::SMESH_Mesh_ptr );
void init( SMESH::SMESH_GroupBase_ptr, void init( SMESH::SMESH_GroupBase_ptr,
const bool theIsConvert = false ); const bool theIsConvert = false );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
void setSelectionMode( int ); void setSelectionMode( int );
void updateButtons(); void updateButtons();

View File

@ -204,7 +204,7 @@ QWidget* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent)
// connect signals and slots // connect signals and slots
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); 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(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
@ -228,7 +228,7 @@ void SMESHGUI_GroupOpDlg::Init()
// selection and SMESHGUI // selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnClose())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// set selection mode // set selection mode
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
@ -315,14 +315,14 @@ void SMESHGUI_GroupOpDlg::onOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if ( onApply() ) if ( onApply() )
onClose(); reject();
setIsApplyAndClose( false ); 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 )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
@ -331,7 +331,7 @@ void SMESHGUI_GroupOpDlg::onClose()
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
reset(); reset();
reject(); QDialog::reject();
} }
/*! /*!
@ -467,14 +467,6 @@ void SMESHGUI_GroupOpDlg::enterEvent(QEvent*)
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP)); 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. \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 Usually called by onApply() slot to reinitialize dialog fields. This virtual method

View File

@ -92,13 +92,14 @@ protected:
bool isApplyAndClose() const; bool isApplyAndClose() const;
private: private:
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
protected slots:
virtual void reject();
private slots: private slots:
void onOk(); void onOk();
void onClose();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();

View File

@ -552,7 +552,7 @@ void SMESHGUI_MergeDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
@ -571,7 +571,7 @@ void SMESHGUI_MergeDlg::Init()
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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 // Init Mesh field from selection
SelectionIntoArgument(); SelectionIntoArgument();
@ -697,14 +697,14 @@ bool SMESHGUI_MergeDlg::ClickOnApply()
void SMESHGUI_MergeDlg::ClickOnOk() void SMESHGUI_MergeDlg::ClickOnOk()
{ {
if (ClickOnApply()) if (ClickOnApply())
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_MergeDlg::ClickOnCancel() void SMESHGUI_MergeDlg::reject()
{ {
myIdPreview->SetPointsLabeled(false); myIdPreview->SetPointsLabeled(false);
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
@ -718,7 +718,7 @@ void SMESHGUI_MergeDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -1226,26 +1226,6 @@ void SMESHGUI_MergeDlg::enterEvent(QEvent*)
ActivateThisDialog(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -78,9 +78,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
void onEditGroup(); void onEditGroup();
@ -150,9 +148,11 @@ private:
QString myEntry; QString myEntry;
GrpList myGroups; GrpList myGroups;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void updateControls(); void updateControls();

View File

@ -352,7 +352,7 @@ QWidget* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent)
aLay->addWidget(myHelpBtn); aLay->addWidget(myHelpBtn);
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); 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(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
@ -390,7 +390,7 @@ void SMESHGUI_MeshPatternDlg::Init()
// selection and SMESHGUI // selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
myTypeGrp->button(Type_2d)->setChecked(true); myTypeGrp->button(Type_2d)->setChecked(true);
onTypeChanged(Type_2d); onTypeChanged(Type_2d);
@ -538,14 +538,14 @@ bool SMESHGUI_MeshPatternDlg::onApply()
void SMESHGUI_MeshPatternDlg::onOk() void SMESHGUI_MeshPatternDlg::onOk()
{ {
if (onApply()) if (onApply())
onClose(); reject();
} }
//======================================================================= //=======================================================================
// name : SMESHGUI_MeshPatternDlg::onClose // name : SMESHGUI_MeshPatternDlg::reject
// Purpose : SLOT called when "Close" button pressed. Close dialog // Purpose : SLOT called when "Close" button pressed. Close dialog
//======================================================================= //=======================================================================
void SMESHGUI_MeshPatternDlg::onClose() void SMESHGUI_MeshPatternDlg::reject()
{ {
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
SMESH::SetPickable(); SMESH::SetPickable();
@ -555,7 +555,7 @@ void SMESHGUI_MeshPatternDlg::onClose()
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
erasePreview(); erasePreview();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -724,15 +724,6 @@ void SMESHGUI_MeshPatternDlg::enterEvent (QEvent*)
onTextChanged(mySelEdit[Ids]->text()); onTextChanged(mySelEdit[Ids]->text());
} }
//=======================================================================
// name : SMESHGUI_MeshPatternDlg::closeEvent
// Purpose :
//=======================================================================
void SMESHGUI_MeshPatternDlg::closeEvent (QCloseEvent*)
{
onClose();
}
//======================================================================= //=======================================================================
// name : SMESHGUI_MeshPatternDlg::onSelInputChanged // name : SMESHGUI_MeshPatternDlg::onSelInputChanged
// Purpose : SLOT. Called when -> button clicked. // Purpose : SLOT. Called when -> button clicked.

View File

@ -75,10 +75,12 @@ public:
void Init(); void Init();
protected slots:
virtual void reject();
private slots: private slots:
void onOk(); void onOk();
bool onApply(); bool onApply();
void onClose();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
@ -108,7 +110,6 @@ private:
void activateSelection(); void activateSelection();
QStringList prepareFilters() const; QStringList prepareFilters() const;
QString autoExtension( const QString& ) const; QString autoExtension( const QString& ) const;
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
bool isValid( const bool = true ); bool isValid( const bool = true );

View File

@ -384,14 +384,14 @@ void SMESHGUI_MultiEditDlg::Init()
// main buttons // main buttons
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); 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(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI // selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// dialog controls // dialog controls
connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() )); connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() ));
@ -423,7 +423,7 @@ void SMESHGUI_MultiEditDlg::Init()
void SMESHGUI_MultiEditDlg::onOk() void SMESHGUI_MultiEditDlg::onOk()
{ {
if (onApply()) 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 // Purpose : SLOT called when "Close" button pressed. Close dialog
//======================================================================= //=======================================================================
void SMESHGUI_MultiEditDlg::onClose() void SMESHGUI_MultiEditDlg::reject()
{ {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
@ -527,7 +527,7 @@ void SMESHGUI_MultiEditDlg::onClose()
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters(); 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 // name : SMESHGUI_MultiEditDlg::onFilterBtn
// Purpose : SLOT. Called when "Filter" button pressed. // Purpose : SLOT. Called when "Filter" button pressed.
@ -1259,10 +1241,10 @@ SMESHGUI_CuttingOfQuadsDlg::~SMESHGUI_CuttingOfQuadsDlg()
{ {
} }
void SMESHGUI_CuttingOfQuadsDlg::onClose() void SMESHGUI_CuttingOfQuadsDlg::reject()
{ {
erasePreview(); erasePreview();
SMESHGUI_MultiEditDlg::onClose(); SMESHGUI_MultiEditDlg::reject();
} }
bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,

View File

@ -82,7 +82,7 @@ signals:
protected slots: protected slots:
void onOk(); void onOk();
virtual bool onApply(); virtual bool onApply();
virtual void onClose(); virtual void reject();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
@ -102,9 +102,7 @@ protected slots:
SMESH::NumericalFunctor_ptr getNumericalFunctor(); SMESH::NumericalFunctor_ptr getNumericalFunctor();
protected: protected:
void closeEvent( QCloseEvent* );
void enterEvent( QEvent * ); void enterEvent( QEvent * );
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
QWidget* createButtonFrame( QWidget* ); QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame( QWidget*, const bool ); QWidget* createMainFrame( QWidget*, const bool );
@ -221,7 +219,7 @@ protected:
SMESH::SMESH_IDSource_ptr obj); SMESH::SMESH_IDSource_ptr obj);
protected slots: protected slots:
virtual void onClose(); virtual void reject();
void onCriterionRB(); void onCriterionRB();
void onPreviewChk(); void onPreviewChk();

View File

@ -370,7 +370,7 @@ void SMESHGUI_NodesDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); 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( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) ); connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
@ -381,8 +381,8 @@ void SMESHGUI_NodesDlg::Init()
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( SelectionIntoArgument() ) ); connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( SelectionIntoArgument() ) );
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) ); connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study frame change */ /* to close dialog if study frame change */
connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( ClickOnCancel() ) ); connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( reject() ) );
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// set selection mode // set selection mode
SMESH::SetPointRepresentation( true ); SMESH::SetPointRepresentation( true );
@ -414,7 +414,7 @@ void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue )
void SMESHGUI_NodesDlg::ClickOnOk() void SMESHGUI_NodesDlg::ClickOnOk()
{ {
if ( ClickOnApply() ) if ( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
@ -539,10 +539,10 @@ bool SMESHGUI_NodesDlg::ClickOnApply()
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_NodesDlg::ClickOnCancel() void SMESHGUI_NodesDlg::reject()
{ {
disconnect( mySelectionMgr, 0, this, 0 ); disconnect( mySelectionMgr, 0, this, 0 );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) ) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
@ -552,7 +552,7 @@ void SMESHGUI_NodesDlg::ClickOnCancel()
SMESH::SetPointRepresentation( false ); SMESH::SetPointRepresentation( false );
mySMESHGUI->ResetState(); 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() // function : enterEvent()
// purpose : to reactivate this dialog box when mouse enter onto the window // purpose : to reactivate this dialog box when mouse enter onto the window

View File

@ -79,8 +79,6 @@ private:
void Init(); void Init();
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void closeEvent( QCloseEvent* );
void hideEvent ( QHideEvent* );
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
bool isValid(); bool isValid();
@ -108,9 +106,11 @@ private:
QString myHelpFileName; QString myHelpFileName;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void DeactivateActiveDialog(); void DeactivateActiveDialog();

View File

@ -435,7 +435,7 @@ SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*
// Connect section // Connect section
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) ); connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) );
connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) ); 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( myHelpBtn, SIGNAL(clicked()), this, SLOT( onHelp() ) );
connect( myMinEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) ); connect( myMinEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
connect( myMaxEdit, 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( myDistributionGrp, SIGNAL( toggled(bool) ), this, SLOT(onDistributionActivated(bool)) );
connect( myDistribColorGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onDistributionChanged( int ) ) ); connect( myDistribColorGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onDistributionChanged( int ) ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) ); 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"; myHelpFileName = "quality_page.html";
} }
@ -471,7 +471,7 @@ SMESHGUI_Preferences_ScalarBarDlg::~SMESHGUI_Preferences_ScalarBarDlg()
void SMESHGUI_Preferences_ScalarBarDlg::onOk() void SMESHGUI_Preferences_ScalarBarDlg::onOk()
{ {
if ( onApply() ) if ( onApply() )
onCancel(); reject();
} }
//================================================================================================= //=================================================================================================
@ -588,14 +588,15 @@ bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
//================================================================================================= //=================================================================================================
/*! /*!
* SMESHGUI_Preferences_ScalarBarDlg::onCancel * SMESHGUI_Preferences_ScalarBarDlg::reject
* *
* Cancel button slot * 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 ); 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 * SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged

View File

@ -64,17 +64,18 @@ public:
static void ScalarBarProperties( SMESHGUI* ); static void ScalarBarProperties( SMESHGUI* );
void closeEvent( QCloseEvent* );
void setOriginAndSize( const double, void setOriginAndSize( const double,
const double, const double,
const double, const double,
const double ); const double );
void initScalarBarFromResources(); void initScalarBarFromResources();
protected slots:
virtual void reject();
protected slots: protected slots:
void onOk(); void onOk();
bool onApply(); bool onApply();
void onCancel();
void onHelp(); void onHelp();
void onSelectionChanged(); void onSelectionChanged();
void onXYChanged(); void onXYChanged();

View File

@ -196,7 +196,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
@ -204,7 +204,7 @@ void SMESHGUI_RemoveElementsDlg::Init()
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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&)), connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&))); SLOT(onTextChange(const QString&)));
@ -257,14 +257,14 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply()
void SMESHGUI_RemoveElementsDlg::ClickOnOk() void SMESHGUI_RemoveElementsDlg::ClickOnOk()
{ {
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_RemoveElementsDlg::ClickOnCancel() void SMESHGUI_RemoveElementsDlg::reject()
{ {
if (SMESH::GetCurrentVtkView()) if (SMESH::GetCurrentVtkView())
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
@ -274,7 +274,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -457,26 +457,6 @@ void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*)
ActivateThisDialog(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -63,9 +63,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
LightApp_SelectionMgr* mySelectionMgr; LightApp_SelectionMgr* mySelectionMgr;
@ -96,9 +94,11 @@ private:
SMESHGUI_FilterDlg* myFilterDlg; SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -196,7 +196,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
@ -204,7 +204,7 @@ void SMESHGUI_RemoveNodesDlg::Init()
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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&)), connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&))); SLOT(onTextChange(const QString&)));
@ -261,14 +261,14 @@ void SMESHGUI_RemoveNodesDlg::ClickOnApply()
void SMESHGUI_RemoveNodesDlg::ClickOnOk() void SMESHGUI_RemoveNodesDlg::ClickOnOk()
{ {
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_RemoveNodesDlg::ClickOnCancel() void SMESHGUI_RemoveNodesDlg::reject()
{ {
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) { if (SMESH::GetCurrentVtkView()) {
@ -280,7 +280,7 @@ void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -463,26 +463,6 @@ void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*)
ActivateThisDialog(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -63,9 +63,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
LightApp_SelectionMgr* mySelectionMgr; LightApp_SelectionMgr* mySelectionMgr;
@ -96,9 +94,11 @@ private:
SMESHGUI_FilterDlg* myFilterDlg; SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -186,7 +186,7 @@ void SMESHGUI_RenumberingDlg::Init()
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
@ -194,7 +194,7 @@ void SMESHGUI_RenumberingDlg::Init()
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel())); connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
myEditCurrentArgument = LineEditMesh; myEditCurrentArgument = LineEditMesh;
LineEditMesh->setFocus(); LineEditMesh->setFocus();
@ -254,20 +254,20 @@ void SMESHGUI_RenumberingDlg::ClickOnApply()
void SMESHGUI_RenumberingDlg::ClickOnOk() void SMESHGUI_RenumberingDlg::ClickOnOk()
{ {
ClickOnApply(); ClickOnApply();
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_RenumberingDlg::ClickOnCancel() void SMESHGUI_RenumberingDlg::reject()
{ {
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -392,26 +392,6 @@ void SMESHGUI_RenumberingDlg::enterEvent(QEvent* e)
ActivateThisDialog(); 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() // function : keyPressEvent()
// purpose : // purpose :

View File

@ -60,9 +60,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
@ -89,9 +87,11 @@ private:
QString myHelpFileName; QString myHelpFileName;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
void ClickOnApply(); void ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -323,7 +323,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); 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(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
@ -574,21 +574,27 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
void SMESHGUI_RevolutionDlg::ClickOnOk() void SMESHGUI_RevolutionDlg::ClickOnOk()
{ {
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=================================================================================
void SMESHGUI_RevolutionDlg::ClickOnCancel()
{
reject(); reject();
} }
//=================================================================================
// function : reject()
// purpose :
//=================================================================================
void SMESHGUI_RevolutionDlg::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(); 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 //function : onSelectMesh
//purpose : //purpose :

View File

@ -74,13 +74,10 @@ public:
SMESHGUI_RevolutionDlg( SMESHGUI* ); SMESHGUI_RevolutionDlg( SMESHGUI* );
~SMESHGUI_RevolutionDlg(); ~SMESHGUI_RevolutionDlg();
void reject();
private: private:
enum {NONE_SELECT, POINT_SELECT, FACE_SELECT}; enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
void Init( bool = true); void Init( bool = true);
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
@ -163,11 +160,11 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -297,7 +297,7 @@ SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule ) :
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); 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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -508,14 +508,14 @@ void SMESHGUI_RotationDlg::ClickOnOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_RotationDlg::ClickOnCancel() void SMESHGUI_RotationDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
@ -527,7 +527,7 @@ void SMESHGUI_RotationDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -857,26 +857,6 @@ void SMESHGUI_RotationDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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() // function : onSelectMesh()
// purpose : // purpose :

View File

@ -66,9 +66,7 @@ public:
private: private:
void Init( bool = true ); void Init( bool = true );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
bool IsAxisOk(); bool IsAxisOk();
void setNewMeshName(); void setNewMeshName();
@ -135,10 +133,10 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -301,7 +301,7 @@ SMESHGUI_ScaleDlg::SMESHGUI_ScaleDlg( SMESHGUI* theModule ) :
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); 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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -545,14 +545,14 @@ void SMESHGUI_ScaleDlg::ClickOnOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_ScaleDlg::ClickOnCancel() void SMESHGUI_ScaleDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
@ -564,7 +564,7 @@ void SMESHGUI_ScaleDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -881,26 +881,6 @@ void SMESHGUI_ScaleDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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 //function : onSelectMesh
//purpose : //purpose :

View File

@ -62,9 +62,7 @@ public:
private: private:
void Init( bool = true ); void Init( bool = true );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
void setNewMeshName(); void setNewMeshName();
@ -130,11 +128,11 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -257,7 +257,7 @@ SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); 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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(LineEdit2, 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() void SMESHGUI_SewingDlg::ClickOnOk()
{ {
if (ClickOnApply()) if (ClickOnApply())
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_SewingDlg::ClickOnCancel() void SMESHGUI_SewingDlg::reject()
{ {
//mySelectionMgr->clearSelected(); //mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
@ -563,7 +563,7 @@ void SMESHGUI_SewingDlg::ClickOnCancel()
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -873,26 +873,6 @@ void SMESHGUI_SewingDlg::enterEvent (QEvent* e)
ActivateThisDialog(); 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() // function : GetConstructorId()
// purpose : // purpose :

View File

@ -63,9 +63,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
bool IsValid(); bool IsValid();
@ -118,10 +116,12 @@ private:
QString myHelpFileName; QString myHelpFileName;
protected slots:
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -215,14 +215,14 @@ void SMESHGUI_SingleEditDlg::Init()
// main buttons // main buttons
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); 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(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI // selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); 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&))); connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
myOkBtn->setEnabled(false); myOkBtn->setEnabled(false);
@ -244,14 +244,14 @@ void SMESHGUI_SingleEditDlg::Init()
void SMESHGUI_SingleEditDlg::onOk() void SMESHGUI_SingleEditDlg::onOk()
{ {
if (onApply()) if (onApply())
onClose(); reject();
} }
//======================================================================= //=======================================================================
// name : onClose() // name : reject()
// Purpose : SLOT called when "Close" button pressed. Close dialog // Purpose : SLOT called when "Close" button pressed. Close dialog
//======================================================================= //=======================================================================
void SMESHGUI_SingleEditDlg::onClose() void SMESHGUI_SingleEditDlg::reject()
{ {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
@ -259,7 +259,7 @@ void SMESHGUI_SingleEditDlg::onClose()
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0); disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState(); 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() // function : onApply()
// purpose : SLOT. Called when apply button is pressed // purpose : SLOT. Called when apply button is pressed

View File

@ -62,7 +62,7 @@ public:
protected slots: protected slots:
void onOk(); void onOk();
virtual bool onApply(); virtual bool onApply();
void onClose(); virtual void reject();
void onHelp(); void onHelp();
void onDeactivate(); void onDeactivate();
@ -71,9 +71,7 @@ protected slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
protected: protected:
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); void enterEvent( QEvent* );
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
QWidget* createButtonFrame( QWidget* ); QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame( QWidget* ); QWidget* createMainFrame( QWidget* );

View File

@ -275,7 +275,7 @@ SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
/***************************************************************/ /***************************************************************/
// signals and slots connections // signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); 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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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&)), connect(LineEditElements, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&))); SLOT(onTextChange(const QString&)));
connect(LineEditNodes, SIGNAL(textChanged(const QString&)), connect(LineEditNodes, SIGNAL(textChanged(const QString&)),
@ -421,14 +421,14 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply()
void SMESHGUI_SmoothingDlg::ClickOnOk() void SMESHGUI_SmoothingDlg::ClickOnOk()
{ {
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : Called when dialog box is closed // purpose : Called when dialog box is closed
//================================================================================= //=================================================================================
void SMESHGUI_SmoothingDlg::ClickOnCancel() void SMESHGUI_SmoothingDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
@ -441,7 +441,7 @@ void SMESHGUI_SmoothingDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -704,26 +704,6 @@ void SMESHGUI_SmoothingDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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() // function : onSelectMesh()
// purpose : // purpose :

View File

@ -71,9 +71,7 @@ public:
private: private:
void Init(); void Init();
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
void setFilters( const bool theIsElem ); void setFilters( const bool theIsElem );
@ -124,9 +122,11 @@ private:
QPushButton* myElemFilterBtn; QPushButton* myElemFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg; SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
virtual void reject();
private slots: private slots:
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -300,7 +300,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); 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(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -573,14 +573,14 @@ void SMESHGUI_SymmetryDlg::ClickOnOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_SymmetryDlg::ClickOnCancel() void SMESHGUI_SymmetryDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
@ -592,7 +592,7 @@ void SMESHGUI_SymmetryDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection); aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -917,26 +917,6 @@ void SMESHGUI_SymmetryDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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 //function : onSelectMesh
//purpose : //purpose :

View File

@ -66,9 +66,7 @@ public:
private: private:
void Init( bool = true ); void Init( bool = true );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
bool IsMirrorOk(); bool IsMirrorOk();
@ -139,11 +137,11 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();

View File

@ -304,7 +304,7 @@ SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule ) :
/* signals and slots connections */ /* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); 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(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int))); 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(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */ /* 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(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int))); connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
@ -578,14 +578,14 @@ void SMESHGUI_TranslationDlg::ClickOnOk()
{ {
setIsApplyAndClose( true ); setIsApplyAndClose( true );
if( ClickOnApply() ) if( ClickOnApply() )
ClickOnCancel(); reject();
} }
//================================================================================= //=================================================================================
// function : ClickOnCancel() // function : reject()
// purpose : // purpose :
//================================================================================= //=================================================================================
void SMESHGUI_TranslationDlg::ClickOnCancel() void SMESHGUI_TranslationDlg::reject()
{ {
disconnect(mySelectionMgr, 0, this, 0); disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
@ -597,7 +597,7 @@ void SMESHGUI_TranslationDlg::ClickOnCancel()
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection ); aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState(); mySMESHGUI->ResetState();
reject(); QDialog::reject();
} }
//================================================================================= //=================================================================================
@ -883,26 +883,6 @@ void SMESHGUI_TranslationDlg::enterEvent (QEvent*)
ActivateThisDialog(); 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 //function : onSelectMesh
//purpose : //purpose :

View File

@ -65,9 +65,7 @@ public:
private: private:
void Init( bool = true ); void Init( bool = true );
void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */ void enterEvent( QEvent* ); /* mouse enter the QWidget */
void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* ); void keyPressEvent( QKeyEvent* );
int GetConstructorId(); int GetConstructorId();
void setNewMeshName(); void setNewMeshName();
@ -133,11 +131,11 @@ private:
protected slots: protected slots:
virtual void onDisplaySimulation( bool ); virtual void onDisplaySimulation( bool );
virtual void reject();
private slots: private slots:
void ConstructorsClicked( int ); void ConstructorsClicked( int );
void ClickOnOk(); void ClickOnOk();
void ClickOnCancel();
bool ClickOnApply(); bool ClickOnApply();
void ClickOnHelp(); void ClickOnHelp();
void SetEditCurrentArgument(); void SetEditCurrentArgument();