1 #include "CAM_DataModel.h"
3 #include "CAM_Module.h"
4 #include "CAM_RootObject.h"
6 /*!Constructor. Initialise module by \a module.*/
7 CAM_DataModel::CAM_DataModel( CAM_Module* module )
13 /*!Destructor. Do nothing.*/
14 CAM_DataModel::~CAM_DataModel()
18 void CAM_DataModel::initialize()
20 //! Default implementation, does nothing.\n
21 //! Can be used for creation of root object.
25 *\retval CAM_DataObject pointer - root object.
27 CAM_DataObject* CAM_DataModel::root() const
32 /*!Sets root object to \a newRoot.\n
33 *Emit root changed, if it was.
34 *\param newRoot - new root object
36 void CAM_DataModel::setRoot( const CAM_DataObject* newRoot )
38 if ( myRoot == newRoot )
42 myRoot->disconnect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
44 myRoot = (CAM_DataObject*)newRoot;
47 myRoot->connect( this, SLOT( onDestroyed( SUIT_DataObject* ) ) );
49 emit rootChanged( this );
53 *\retval CAM_Module pointer - module.
55 CAM_Module* CAM_DataModel::module() const
60 /*!Nullify root, if \a obj equal root.*/
61 void CAM_DataModel::onDestroyed( SUIT_DataObject* obj )