1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File : SMESHGUI_WhatIsDlg.cxx
24 // Author : Vladimir TURIN
28 #include "SMESHGUI_WhatIsDlg.h"
31 #include "SMESHGUI_SpinBox.h"
32 #include "SMESHGUI_Utils.h"
33 #include "SMESHGUI_VTKUtils.h"
34 #include "SMESHGUI_MeshUtils.h"
35 #include "SMESHGUI_IdValidator.h"
37 #include "SMESH_Actor.h"
38 #include "SMESH_TypeFilter.hxx"
39 #include "SMESH_LogicalFilter.hxx"
40 #include "SMDS_Mesh.hxx"
41 #include "SMDS_VolumeTool.hxx"
43 #include "SUIT_Desktop.h"
44 #include "SUIT_ResourceMgr.h"
45 #include "SUIT_Session.h"
46 #include "SUIT_MessageBox.h"
48 #include "LightApp_Application.h"
50 #include "SVTK_ViewModel.h"
51 #include "SVTK_Selection.h"
52 #include "SVTK_ViewWindow.h"
53 #include "SVTK_Selector.h"
54 #include "SALOME_ListIO.hxx"
55 #include "SALOME_ListIteratorOfListIO.hxx"
57 #include "utilities.h"
60 #include <TColStd_MapOfInteger.hxx>
61 #include <TColStd_IndexedMapOfInteger.hxx>
65 #include <qapplication.h>
66 #include <qbuttongroup.h>
67 #include <qgroupbox.h>
69 #include <qlineedit.h>
70 #include <qpushbutton.h>
71 #include <qradiobutton.h>
72 #include <qcheckbox.h>
76 #include <qtextbrowser.h>
79 #include "SALOMEconfig.h"
80 #include CORBA_SERVER_HEADER(SMESH_Group)
81 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
85 //=================================================================================
86 // class : SMESHGUI_WhatIsDlg()
88 //=================================================================================
89 SMESHGUI_WhatIsDlg::SMESHGUI_WhatIsDlg( SMESHGUI* theModule, const char* name,
90 bool modal, WFlags fl)
91 : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
92 WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
93 mySMESHGUI( theModule ),
94 mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
97 setName("SMESHGUI_WhatIsDlg");
99 setCaption(tr("SMESH_WHAT_IS_TITLE"));
100 setSizeGripEnabled(TRUE);
101 SMESHGUI_WhatIsDlgLayout = new QGridLayout(this);
102 SMESHGUI_WhatIsDlgLayout->setSpacing(6);
103 SMESHGUI_WhatIsDlgLayout->setMargin(11);
105 /***************************************************************/
106 GroupMesh = new QButtonGroup(this, "GroupSelections");
107 GroupMesh->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupMesh->sizePolicy().hasHeightForWidth()));
108 GroupMesh->setTitle(tr(""));
109 GroupMesh->setColumnLayout(0, Qt::Vertical);
110 GroupMesh->layout()->setSpacing(0);
111 GroupMesh->layout()->setMargin(0);
112 GroupMeshLayout = new QGridLayout(GroupMesh->layout());
113 GroupMeshLayout->setAlignment(Qt::AlignTop);
114 GroupMeshLayout->setSpacing(6);
115 GroupMeshLayout->setMargin(11);
116 MeshLabel = new QLabel(GroupMesh, "MeshLabel");
117 MeshLabel->setText(tr("SMESH_NAME"));
118 GroupMeshLayout->addWidget(MeshLabel, 0, 0);
119 MeshName = new QLabel(GroupMesh, "MeshName");
120 MeshName->setText(tr(""));
121 GroupMeshLayout->addWidget(MeshName, 0, 1);
122 SMESHGUI_WhatIsDlgLayout->addWidget(GroupMesh, 0, 0);
124 /***************************************************************/
125 GroupSelections = new QButtonGroup(this, "GroupSelections");
126 GroupSelections->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupSelections->sizePolicy().hasHeightForWidth()));
127 GroupSelections->setTitle(tr("ENTITY_TYPE" ));
128 GroupSelections->setExclusive(TRUE);
129 GroupSelections->setColumnLayout(0, Qt::Vertical);
130 GroupSelections->layout()->setSpacing(0);
131 GroupSelections->layout()->setMargin(0);
132 GroupSelectionsLayout = new QGridLayout(GroupSelections->layout());
133 GroupSelectionsLayout->setAlignment(Qt::AlignTop);
134 GroupSelectionsLayout->setSpacing(6);
135 GroupSelectionsLayout->setMargin(11);
136 RadioButtonNodes = new QRadioButton(GroupSelections, "RadioButtonNodes");
137 RadioButtonNodes->setText(tr("SMESH_NODES"));
138 GroupSelectionsLayout->addWidget(RadioButtonNodes, 0, 0);
139 RadioButtonElements = new QRadioButton(GroupSelections, "RadioButtonElements");
140 RadioButtonElements->setText(tr("SMESH_ELEMENTS"));
141 GroupSelectionsLayout->addWidget(RadioButtonElements, 0, 1 );
142 SMESHGUI_WhatIsDlgLayout->addWidget(GroupSelections, 1, 0);
144 /***************************************************************/
145 GroupArguments = new QGroupBox(this, "GroupArguments");
146 GroupArguments->setTitle(tr("SMESH_INFORMATION"));
147 GroupArguments->setColumnLayout(0, Qt::Vertical);
148 GroupArguments->layout()->setSpacing(0);
149 GroupArguments->layout()->setMargin(0);
150 GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
151 GroupArgumentsLayout->setAlignment(Qt::AlignTop);
152 GroupArgumentsLayout->setSpacing(6);
153 GroupArgumentsLayout->setMargin(11);
155 // Controls for elements selection
156 TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
157 TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
158 TextLabelElements->setFixedWidth(74);
159 GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
161 LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
162 LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
163 GroupArgumentsLayout->addMultiCellWidget(LineEditElements, 0, 0, 2, 7);
165 // information text browser
166 Info = new QTextBrowser(GroupArguments, "Info");
167 Info->setHScrollBarMode(QScrollView::AlwaysOff);
168 Info->setVScrollBarMode(QScrollView::AlwaysOff);
169 GroupArgumentsLayout->addMultiCellWidget(Info, 1, 1, 0, 7);
171 SMESHGUI_WhatIsDlgLayout->addWidget(GroupArguments, 2, 0);
173 /***************************************************************/
174 GroupButtons = new QGroupBox(this, "GroupButtons");
175 GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth()));
176 GroupButtons->setTitle(tr("" ));
177 GroupButtons->setColumnLayout(0, Qt::Vertical);
178 GroupButtons->layout()->setSpacing(0);
179 GroupButtons->layout()->setMargin(0);
180 GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
181 GroupButtonsLayout->setAlignment(Qt::AlignTop);
182 GroupButtonsLayout->setSpacing(6);
183 GroupButtonsLayout->setMargin(11);
184 buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
185 buttonHelp->setText(tr("SMESH_BUT_HELP" ));
186 buttonHelp->setAutoDefault(TRUE);
187 GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
188 QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
189 GroupButtonsLayout->addItem(spacer_9, 0, 1);
190 buttonOk = new QPushButton(GroupButtons, "buttonOk");
191 buttonOk->setText(tr("SMESH_BUT_OK" ));
192 buttonOk->setAutoDefault(TRUE);
193 buttonOk->setDefault(TRUE);
194 GroupButtonsLayout->addWidget(buttonOk, 0, 0);
195 SMESHGUI_WhatIsDlgLayout->addWidget(GroupButtons, 3, 0);
197 GroupArguments->show();
198 RadioButtonNodes->setChecked(TRUE);
200 mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
202 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
204 // Costruction of the logical filter
205 SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
206 SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
208 QPtrList<SUIT_SelectionFilter> aListOfFilters;
209 if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
210 if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
212 myMeshOrSubMeshOrGroupFilter =
213 new SMESH_LogicalFilter(aListOfFilters, SMESH_LogicalFilter::LO_OR);
215 myHelpFileName = "mesh_infos_page.html#mesh_element_info_anchor";
219 /* signals and slots connections */
220 connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
221 connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
222 connect(GroupSelections, SIGNAL(clicked(int)), SLOT(SelectionsClicked(int)));
224 connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
225 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
226 /* to close dialog if study change */
227 connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
228 connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
229 this->show(); /* displays Dialog */
231 SelectionsClicked(0);
232 SelectionIntoArgument();
235 //=================================================================================
236 // function : ~SMESHGUI_WhatIsDlg()
237 // purpose : Destroys the object and frees any allocated resources
238 //=================================================================================
239 SMESHGUI_WhatIsDlg::~SMESHGUI_WhatIsDlg()
241 // no need to delete child widgets, Qt does it all for us
244 //=================================================================================
247 //=================================================================================
248 void SMESHGUI_WhatIsDlg::Init (bool ResetControls)
252 LineEditElements->clear();
255 myMesh = SMESH::SMESH_Mesh::_nil();
258 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
259 aViewWindow->SetSelectionMode( CellSelection );
260 onTextChange(LineEditElements->text());
262 SelectionIntoArgument();
266 //=================================================================================
267 // function : SelectionsClicked()
268 // purpose : Radio button management
269 //=================================================================================
270 void SMESHGUI_WhatIsDlg::SelectionsClicked (int selectionId)
272 disconnect(mySelectionMgr, 0, this, 0);
274 mySelectionMgr->clearFilters();
276 switch (selectionId) {
279 SMESH::SetPointRepresentation(true);
280 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
281 aViewWindow->SetSelectionMode( NodeSelection );
286 SMESH::SetPointRepresentation(false);
287 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
288 aViewWindow->SetSelectionMode( CellSelection );
293 connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
294 SelectionIntoArgument();
297 //=================================================================================
298 // function : ClickOnOk()
300 //=================================================================================
301 void SMESHGUI_WhatIsDlg::ClickOnOk()
303 if (mySMESHGUI->isActiveStudyLocked())
308 SelectionIntoArgument();
312 //=================================================================================
313 // function : ClickOnCancel()
315 //=================================================================================
316 void SMESHGUI_WhatIsDlg::ClickOnCancel()
318 disconnect(mySelectionMgr, 0, this, 0);
319 mySelectionMgr->clearFilters();
320 SMESH::SetPointRepresentation(false);
321 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
322 aViewWindow->SetSelectionMode( ActorSelection );
323 mySMESHGUI->ResetState();
327 //=================================================================================
328 // function : ClickOnHelp()
330 //=================================================================================
331 void SMESHGUI_WhatIsDlg::ClickOnHelp()
333 LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
335 app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
337 SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
338 QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
339 arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
340 QObject::tr("BUT_OK"));
344 //=======================================================================
345 // function : onTextChange()
347 //=======================================================================
348 void SMESHGUI_WhatIsDlg::onTextChange (const QString& theNewText)
353 // hilight entered elements
354 SMDS_Mesh* aMesh = 0;
356 aMesh = myActor->GetObject()->GetMesh();
359 Handle(SALOME_InteractiveObject) anIO = myActor->getIO();
361 TColStd_MapOfInteger newIndices;
363 QStringList aListId = QStringList::split(" ", theNewText, false);
365 for (int i = 0; i < aListId.count(); i++) {
366 const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
367 aMesh->FindNode(aListId[ i ].toInt()):
368 aMesh->FindElement(aListId[ i ].toInt());
370 newIndices.Add(e->GetID());
373 mySelector->AddOrRemoveIndex( anIO, newIndices, false );
374 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
375 aViewWindow->highlight( anIO, true, true );
378 SelectionIntoArgument();
383 //=================================================================================
384 // function : SelectionIntoArgument()
385 // purpose : Called when selection as changed or other case
386 //=================================================================================
387 void SMESHGUI_WhatIsDlg::SelectionIntoArgument()
389 int curBusy = myBusy;
393 QString aString = "";
397 LineEditElements->setText(aString);
398 MeshName->setText(aString);
399 GroupMesh->setTitle(tr(""));
403 if (!GroupButtons->isEnabled()) // inactive
408 mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
410 int nbSel = aList.Extent();
415 Handle(SALOME_InteractiveObject) IO = aList.First();
416 myMesh = SMESH::GetMeshByIO(IO);
417 if (myMesh->_is_nil())
421 //check if all selected objects belongs to one mesh
422 SALOME_ListIteratorOfListIO io( aList );
423 for (io.Next(); io.More(); io.Next() ) {
424 SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io.Value());
425 if (!mesh->_is_nil() && !mesh->_is_equivalent( myMesh ))
428 // select IO with any element selected (for case of selection by rectangle)
430 for (io.Initialize(aList); io.More() && IO.IsNull(); io.Next() )
431 if ( mySelector->HasIndex( io.Value() ))
433 if ( IO.IsNull() ) return;
435 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
436 for (io.Initialize(aList); io.More(); io.Next() )
437 if ( !IO->isSame( io.Value() ))
438 aViewWindow->highlight( io.Value(), false, true );
442 myActor = SMESH::FindActorByObject(myMesh);
444 myActor = SMESH::FindActorByEntry(IO->getEntry());
448 QString aName = IO->getName();
449 // cut off wite spaces from tail, else meaningful head is not visible
450 int size = aName.length();
451 while (size && aName.at(size-1).isSpace() )
453 if ( size != aName.length() )
454 aName.truncate( size );
455 MeshName->setText(aName); // can be something like "2 objects"
457 if(!SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO)->_is_nil()) {
458 GroupMesh->setTitle(tr("SMESH_MESH"));
459 } else if(!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil()) {
460 GroupMesh->setTitle(tr("SMESH_SUBMESH"));
461 } else if(!SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) {
462 GroupMesh->setTitle(tr("SMESH_GROUP"));
467 aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
472 const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
473 myActor->GetObject()->GetMesh()->FindNode(aString.toInt()):
474 myActor->GetObject()->GetMesh()->FindElement(aString.toInt());
477 anInfo=tr("ENTITY_TYPE") + ": ";
478 if(e->GetType() == SMDSAbs_Node) {
479 anInfo+=tr("MESH_NODE")+"\n";
480 //const SMDS_MeshNode *en = (SMDS_MeshNode*) e; // VSR: not used!
481 } else if(e->GetType() == SMDSAbs_Edge) {
482 anInfo+=tr("SMESH_EDGE")+"\n";
483 anInfo+=tr("SMESH_MESHINFO_TYPE")+": ";
484 const SMDS_MeshEdge *ee = (SMDS_MeshEdge*) e;
485 anInfo+=(ee->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+"\n";
486 } else if(e->GetType() == SMDSAbs_Face) {
487 const SMDS_MeshFace *ef = (SMDS_MeshFace*) e;
488 anInfo+=tr("SMESH_FACE")+"\n";
489 anInfo+=tr("SMESH_MESHINFO_TYPE")+": ";
491 anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
492 switch(ef->NbNodes()) {
496 anInfo+=tr("SMESH_TRIANGLE");
502 anInfo+=tr("SMESH_QUADRANGLE");
509 } else if(e->GetType() == SMDSAbs_Volume) {
510 anInfo+=tr("SMESH_VOLUME")+"\n";
511 anInfo+=tr("SMESH_MESHINFO_TYPE")+": ";
512 const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e;
513 SMDS_VolumeTool vt(ev);
514 if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA)
515 anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
516 switch(vt.GetVolumeType()) {
517 case SMDS_VolumeTool::TETRA:
518 case SMDS_VolumeTool::QUAD_TETRA:
520 anInfo+=tr("SMESH_TETRAS");
523 case SMDS_VolumeTool::PYRAM:
524 case SMDS_VolumeTool::QUAD_PYRAM:
526 anInfo+=tr("SMESH_PYRAMID");
529 case SMDS_VolumeTool::PENTA:
530 case SMDS_VolumeTool::QUAD_PENTA:
532 anInfo+=tr("SMESH_PRISM");
535 case SMDS_VolumeTool::HEXA:
536 case SMDS_VolumeTool::QUAD_HEXA:
538 anInfo+=tr("SMESH_HEXAS");
541 case SMDS_VolumeTool::POLYHEDA:
543 anInfo+=tr("SMESH_POLYEDRON");
551 if(e->GetType() != SMDSAbs_Node)
552 anInfo+=tr("GRAVITY_CENTER") + ":\n";
553 gp_XYZ anXYZ(0.,0.,0.);
554 SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
556 for( ; nodeIt->more(); nbNodes++) {
557 const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
558 anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
560 anXYZ.Divide(e->NbNodes());
561 anInfo+=QString("X=%1\nY=%2\nZ=%3\n").arg(anXYZ.X()).arg(anXYZ.Y()).arg(anXYZ.Z());
562 Info->setText(anInfo);
567 LineEditElements->setText(aString);
572 //=================================================================================
573 // function : DeactivateActiveDialog()
575 //=================================================================================
576 void SMESHGUI_WhatIsDlg::DeactivateActiveDialog()
578 if (GroupArguments->isEnabled()) {
579 GroupSelections->setEnabled(false);
580 GroupMesh->setEnabled(false);
581 GroupArguments->setEnabled(false);
582 GroupButtons->setEnabled(false);
583 mySMESHGUI->ResetState();
584 mySMESHGUI->SetActiveDialogBox(0);
588 //=================================================================================
589 // function : ActivateThisDialog()
591 //=================================================================================
592 void SMESHGUI_WhatIsDlg::ActivateThisDialog()
594 /* Emit a signal to deactivate the active dialog */
595 mySMESHGUI->EmitSignalDeactivateDialog();
596 GroupArguments->setEnabled(true);
597 GroupButtons->setEnabled(true);
598 GroupSelections->setEnabled(true);
599 GroupMesh->setEnabled(true);
601 mySMESHGUI->SetActiveDialogBox((QDialog*)this);
603 if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
604 SelectionsClicked(RadioButtonNodes->isChecked()?0:1);
606 SelectionIntoArgument();
609 //=================================================================================
610 // function : enterEvent()
612 //=================================================================================
613 void SMESHGUI_WhatIsDlg::enterEvent (QEvent*)
615 if (!GroupArguments->isEnabled())
616 ActivateThisDialog();
619 //=================================================================================
620 // function : closeEvent()
622 //=================================================================================
623 void SMESHGUI_WhatIsDlg::closeEvent (QCloseEvent*)
625 /* same than click on cancel button */
626 this->ClickOnCancel();
629 //=======================================================================
630 //function : hideEvent
631 //purpose : caused by ESC key
632 //=======================================================================
633 void SMESHGUI_WhatIsDlg::hideEvent (QHideEvent*)
639 //=================================================================================
640 // function : keyPressEvent()
642 //=================================================================================
643 void SMESHGUI_WhatIsDlg::keyPressEvent( QKeyEvent* e )
645 QDialog::keyPressEvent( e );
646 if ( e->isAccepted() )
649 if ( e->key() == Key_F1 )