Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCKGUI / HEXABLOCKGUI.cxx
index 22d3ed788a30dd00d3b37bbed5d995531867b9e2..d7319a47d9d31159350c3e41bed67e5961670ecf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -142,7 +142,7 @@ HEXABLOCKGUI::HEXABLOCKGUI() :
           _dwAssociation(0),
           _dwGroups(0),
           _dwMesh(0),
-          _dwObjectBrowser(0),
+//          _dwObjectBrowser(0),
           _dwInputPanel(0),
           _patternDataTreeView(0),
 //          _patternBuilderTreeView(0),
@@ -408,12 +408,22 @@ bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy )
 
     hideActor();
 
+    if(currentOccGView) {
+      delete currentOccGView;
+      currentOccGView = NULL;
+    }
+
+    if(currentDocGView) {
+      delete currentDocGView;
+      currentDocGView = NULL;
+    }
+
     return bOk;
 }
 
 SALOMEDS::Study_var HEXABLOCKGUI::getStudyServant()
 {
-  SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
+  SALOME_NamingService_Abstract *aNamingService = SalomeApp_Application::namingService();
   CORBA::Object_var aSMObject = aNamingService->Resolve("/Study");
   SALOMEDS::Study_var aDSStudy = SALOMEDS::Study::_narrow(aSMObject);
   return aDSStudy._retn();
@@ -854,6 +864,11 @@ void HEXABLOCKGUI::preferencesChanged( const QString& sect, const QString& name
 void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition)
 {
     QModelIndex currentIndex = _patternDataTreeView->currentIndex();
+
+    // if nothing is selected, return
+    if (! currentIndex.isValid())
+      return;
+
     QVariant currentAssocVariant;
     QString currentAssocEntry;
 
@@ -1003,10 +1018,7 @@ void HEXABLOCKGUI::createAndFillDockWidget()
     }
     aParent->tabifyDockWidget( _dwPattern, _dwGroups );
     aParent->tabifyDockWidget( _dwGroups, _dwMesh );
-
-#if QT_VERSION >= 0x040500
     aParent->setTabPosition(Qt::AllDockWidgetAreas, Resource::tabPanelsUp? QTabWidget::North: QTabWidget::South);
-#endif
 
     // popup menu on data tree view
     _patternDataTreeView->setContextMenuPolicy(Qt::CustomContextMenu);