It is not enough to create selector on initialize(). The problem still exists in the second study because it is not called there. So, it is decided to perform this in connectToStudy() of module.
An alternative is to do this in NewGEOM_DataModel before Mgr->load(). The problem is in this place because it causes redisplay signals flush. The viewer should be initialized before this case.
class XGUI_Workshop;
class NewGeom_OCCSelector;
class OCCViewer_Viewer;
+class CAM_Study;
/**
* \ingroup Salome
void inspectSalomeModules();
public slots:
+ /// \brief The method is redefined to connect to the study viewer before the data
+ /// model is filled by opened file. This file open will flush redisplay signals for,
+ /// objects which should be visualized
+ virtual void connectToStudy(CAM_Study* theStudy);
+
/// \brief The method is called on the module activation
/// \param theStudy current study
virtual bool activateModule(SUIT_Study* theStudy);