]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for the issue when the SHAPER module data model was not correctly initialized...
authormpv <mikhail.ponikarov@opencascade.com>
Thu, 11 Jun 2020 13:39:49 +0000 (16:39 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Thu, 11 Jun 2020 13:39:49 +0000 (16:39 +0300)
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_DataModel.h

index 6440bbf1f5ab885b9d004d3cf375e84db1a948f0..983648dcf511b45151cb0381458a9fcb0a07aa66 100644 (file)
@@ -4970,9 +4970,16 @@ void LightApp_Application::onDesktopMessage( const QString& message )
           mod = loadModule(moduleTitle(moduleName));
         if (mod) {
           addModule(mod);
-          CAM_Study* anActiveStudy = dynamic_cast<CAM_Study*>(activeStudy());
-          if (anActiveStudy)
-            mod->connectToStudy(anActiveStudy);
+        }
+      }
+      if (mod) {
+        CAM_Study* anActiveStudy = dynamic_cast<CAM_Study*>(activeStudy());
+        if (anActiveStudy) {
+          mod->connectToStudy(anActiveStudy);
+          LightApp_DataModel* aDM = dynamic_cast<LightApp_DataModel*>(mod->dataModel());
+          if(aDM) {
+            aDM->initRootObject();
+          }
         }
       }
     }
index aec64368bb9efc9af8f449ca26f34b87a154bc01..74016ab3e3085594d7b8867916dfbdffa5b04db8 100644 (file)
@@ -70,6 +70,9 @@ public:
   int  groupId() const;
   void registerColumn( SUIT_DataBrowser*, const QString&, const int );
   void unregisterColumn( SUIT_DataBrowser*, const QString& );
+  //! For initialization of the data model and registration of SComponent when study is created
+  //! but module was not activated.
+  virtual void                        initRootObject() {};
 
 signals:
   void                                opened();