#include <LightApp_DataModel.h>

Signals | |
| void | opened () |
| void | saved () |
| void | closed () |
| void | rootChanged (const CAM_DataModel *) |
| Emitted when the root data object is changed. | |
Public Member Functions | |
| LightApp_DataModel (CAM_Module *theModule) | |
| virtual | ~LightApp_DataModel () |
| virtual bool | open (const QString &, CAM_Study *, QStringList) |
| virtual bool | save (QStringList &) |
| virtual bool | saveAs (const QString &, CAM_Study *, QStringList &) |
| virtual bool | close () |
| virtual void | update (LightApp_DataObject *=0, LightApp_Study *=0) |
| virtual bool | isModified () const |
| virtual bool | isSaved () const |
| LightApp_Module * | getModule () const |
| int | groupId () const |
| void | registerColumn (SUIT_DataBrowser *, const QString &, const int) |
| void | unregisterColumn (SUIT_DataBrowser *, const QString &) |
| virtual void | initialize () |
| Initialize data model. | |
| CAM_DataObject * | root () const |
| Get data model root object. | |
| CAM_Module * | module () const |
| Get module. | |
| virtual bool | create (CAM_Study *) |
| Create empty data model. | |
Protected Member Functions | |
| LightApp_Study * | getStudy () const |
| virtual void | build () |
| virtual void | updateWidgets () |
| virtual void | setRoot (const CAM_DataObject *) |
| Set data model root object. | |
Private Attributes | |
| int | myGroupId |
Description : Base class of data model
| LightApp_DataModel::LightApp_DataModel | ( | CAM_Module * | theModule | ) |
Constructor
References CAM_DataModel.module(), and myGroupId.
| LightApp_DataModel::~LightApp_DataModel | ( | ) | [virtual] |
Destructor
| bool LightApp_DataModel::open | ( | const QString & | , |
| CAM_Study * | study, | ||
| QStringList | |||
| ) | [virtual] |
Emit opened()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight, and SalomeApp_DataModel.
References opened().
| bool LightApp_DataModel::save | ( | QStringList & | ) | [virtual] |
Emit saved()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight.
References saved().
| bool LightApp_DataModel::saveAs | ( | const QString & | , |
| CAM_Study * | , | ||
| QStringList & | |||
| ) | [virtual] |
Emit saved()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight.
References saved().
| bool LightApp_DataModel::close | ( | ) | [virtual] |
Emit closed()
Reimplemented from CAM_DataModel.
Reimplemented in SALOME_PYQT_DataModelLight.
References closed().
| void LightApp_DataModel::update | ( | LightApp_DataObject * | = 0, |
| LightApp_Study * | = 0 |
||
| ) | [virtual] |
Default behaviour of data model update for light modules
Reimplemented in SALOME_PYQT_DataModelLight, and SalomeApp_DataModel.
References build(), SUIT_DataObject.children(), CAM_DataModel.root(), and updateWidgets().
| bool LightApp_DataModel::isModified | ( | ) | const [virtual] |
default implementation, always returns false so as not to mask study's isModified()
Reimplemented in SALOME_PYQT_DataModelLight.
| bool LightApp_DataModel::isSaved | ( | ) | const [virtual] |
default implementation, always returns true so as not to mask study's isSaved()
Reimplemented in SALOME_PYQT_DataModelLight.
| LightApp_Module * LightApp_DataModel::getModule | ( | ) | const |
Reimplemented in SalomeApp_DataModel.
References CAM_DataModel.module().
| int LightApp_DataModel::groupId | ( | ) | const |
References myGroupId.
| void LightApp_DataModel::registerColumn | ( | SUIT_DataBrowser * | browser, |
| const QString & | name, | ||
| const int | custom_id | ||
| ) |
Register custom column in the object browser
| browser | - object browser where new column should be created |
| name | - translated column name |
| custom_id | - custom column identificator passed into data object's methods text(), icon() etc |
References groupId(), OB_Browser.model(), and SUIT_AbstractModel.registerColumn().
| void LightApp_DataModel::unregisterColumn | ( | SUIT_DataBrowser * | browser, |
| const QString & | name | ||
| ) |
Remove registered custom column from the object browser
| browser | - object browser where new column should be created |
| name | - translated column name |
References groupId(), OB_Browser.model(), and SUIT_AbstractModel.unregisterColumn().
| void LightApp_DataModel.opened | ( | ) | [signal] |
| void LightApp_DataModel.saved | ( | ) | [signal] |
| void LightApp_DataModel.closed | ( | ) | [signal] |
| LightApp_Study * LightApp_DataModel::getStudy | ( | ) | const [protected] |
Reimplemented in SalomeApp_DataModel.
References SUIT_DataObject.root(), CAM_DataModel.root(), and LightApp_RootObject.study().
| void LightApp_DataModel::build | ( | ) | [protected, virtual] |
Build whole data model tree
| void LightApp_DataModel::updateWidgets | ( | ) | [protected, virtual] |
Updates data model presentation in some widgets (for example, in object browser
References CAM_Module.application(), CAM_DataModel.module(), LightApp_Application.objectBrowser(), and SUIT_DataBrowser.updateTree().
| void CAM_DataModel::initialize | ( | ) | [virtual, inherited] |
This method should be re-implemented in the successor classes and can be used for creation of root data object. Default implementation does nothing.
| CAM_DataObject * CAM_DataModel::root | ( | ) | const [inherited] |
| CAM_Module * CAM_DataModel::module | ( | ) | const [inherited] |
References CAM_DataModel.myModule.
| bool CAM_DataModel::create | ( | CAM_Study * | ) | [virtual, inherited] |
This method should be re-implemented in the successor classes. Default implementation returns true.
true if data model is created successfully Reimplemented in SALOME_PYQT_DataModelLight, and SalomeApp_DataModel.
| void CAM_DataModel::setRoot | ( | const CAM_DataObject * | newRoot | ) | [protected, virtual, inherited] |
This method should be used to specify custom root object instance.
Root object can be created in several ways, depending on application or module needs:
If root object is changed, this method emits rootChanged() signal.
| newRoot | new root object |
References SUIT_DataObject.connect(), SUIT_DataObject.disconnect(), CAM_DataModel.myRoot, CAM_DataModel.onDestroyed(), and CAM_DataModel.rootChanged().
| void CAM_DataModel::rootChanged | ( | const CAM_DataModel * | root | ) | [signal, inherited] |
| root | new root data object |
int LightApp_DataModel.myGroupId [private] |