Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / VISUGUI / VisuGUI_CutPlanesDlg.cxx
index 845a9a869dd53a8769f24174c131da4f1f9e6748..c4072907cd942daefde932fd03132643960e4129 100644 (file)
@@ -458,17 +458,12 @@ void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
 /*!
   Constructor
 */
-VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule,
-                                            bool theIsCreation, bool theIsModal)
-     : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutPlanesDlg", theIsModal, WStyle_Customize |
-               WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule)
+     : QDialog(VISU::GetDesktop(theModule), "VisuGUI_CutPlanesDlg", false,
+               WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
-  if (!theIsModal) {
-    setWFlags(getWFlags() | WDestructiveClose);
-  }
   setCaption("Cut Planes Definition");
   setSizeGripEnabled(true);
-  myIsCreation = theIsCreation;
 
   QVBoxLayout* TopLayout = new QVBoxLayout (this);
   TopLayout->setSpacing(6);
@@ -535,10 +530,14 @@ void VisuGUI_CutPlanesDlg::accept()
   //  return;
   //}
   if (myScalarPane->check())
-    QDialog::accept();
+    {
+      myScalarPane->deletePreview();
+      QDialog::accept();
+    }
 }
 
 void VisuGUI_CutPlanesDlg::reject() {
+  myScalarPane->deletePreview();
   QDialog::reject();
 }