From: nds Date: Thu, 3 Nov 2005 07:14:34 +0000 (+0000) Subject: Return name of root object as moduleName X-Git-Tag: V3_1_0a3~83 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=65ddf6116a972283782ddf0e4d80ac4a1027c855;p=modules%2Fgui.git Return name of root object as moduleName --- diff --git a/src/CAM/CAM_RootObject.cxx b/src/CAM/CAM_RootObject.cxx index e24827167..d915a7c1d 100755 --- a/src/CAM/CAM_RootObject.cxx +++ b/src/CAM/CAM_RootObject.cxx @@ -1,6 +1,7 @@ #include "CAM_RootObject.h" #include "CAM_DataModel.h" +#include "CAM_Module.h" /*!Constructor. Initialize by \a parent. * Set data model to 0. @@ -26,6 +27,17 @@ CAM_RootObject::~CAM_RootObject() { } +/*! + Returns module name +*/ +QString CAM_RootObject::name() const +{ + QString aName = ""; + if (myDataModel) + aName = myDataModel->module()->moduleName(); + return aName; +} + /*!Get data model *\retval const CAM_DataModel pointer to data model. */ diff --git a/src/CAM/CAM_RootObject.h b/src/CAM/CAM_RootObject.h index dee53d7ba..7e4e2d4b8 100755 --- a/src/CAM/CAM_RootObject.h +++ b/src/CAM/CAM_RootObject.h @@ -18,6 +18,8 @@ public: CAM_RootObject( CAM_DataModel*, SUIT_DataObject* = 0 ); virtual ~CAM_RootObject(); + virtual QString name() const; + virtual CAM_DataModel* dataModel() const; virtual void setDataModel( CAM_DataModel* );