Base data object class to build the data model for all the SALOME modules.
#include <LightApp_DataObject.h>
Classes | |
class | Key |
Represents unique data object key for the LightApp_DataObject class instances. More... | |
Public Types | |
enum | { EntryId = VisibilityId + 1, RefEntryId } |
Column id. More... | |
Public Member Functions | |
LightApp_DataObject (SUIT_DataObject *=0) | |
Constructor. More... | |
virtual | ~LightApp_DataObject () |
Destructor. More... | |
virtual SUIT_DataObjectKey * | key () const |
Get the data object unique key. More... | |
virtual QString | entry () const |
Get object string identifier. More... | |
virtual QString | refEntry () const |
Returns the string identifier of the data objects referenced by this one. More... | |
virtual bool | isReference () const |
Tells if this data objects is a reference to some other or not. More... | |
virtual QString | text (const int=NameId) const |
Get object text data for the specified column. More... | |
virtual QColor | color (const ColorRole, const int=NameId) const |
Get data object color for the specified column. More... | |
virtual SUIT_DataObject * | componentObject () const |
Get the component object. More... | |
virtual QString | componentDataType () const |
Get component type. More... | |
virtual bool | customSorting (const int=NameId) const |
Check if the specified column supports custom sorting. More... | |
virtual bool | compare (const QVariant &, const QVariant &, const int=NameId) const |
Compares data from two items for sorting purposes. More... | |
virtual int | groupId () const |
return unique group identificator More... | |
virtual QVariant | customData (Qtx::CustomDataType type) |
return custom data for data object More... | |
virtual bool | isVisible () const |
Check if the object is visible. More... | |
virtual bool | isDraggable () const |
Check if the object is draggable. More... | |
virtual bool | isDropAccepted () const |
Check if the drop operation fo this object is possible. More... | |
virtual bool | renameAllowed (const int=NameId) const |
Check if this object is can't be renamed in place. More... | |
virtual bool | setName (const QString &) |
Set name of the this object. More... | |
Public Member Functions inherited from CAM_DataObject | |
CAM_DataObject (SUIT_DataObject *=0) | |
Constructor. More... | |
virtual | ~CAM_DataObject () |
Destructor. More... | |
CAM_Module * | module () const |
Get CAM module. More... | |
virtual CAM_DataModel * | dataModel () const |
Get CAM data model. More... | |
Public Member Functions inherited from SUIT_DataObject | |
SUIT_DataObject (SUIT_DataObject *=0) | |
Constructor. More... | |
virtual | ~SUIT_DataObject () |
Destructor. More... | |
SUIT_DataObject * | root () const |
Get the root object. More... | |
SUIT_DataObject * | lastChild () const |
Get the last child object. More... | |
SUIT_DataObject * | firstChild () const |
Get the first child object. More... | |
int | childCount () const |
Get the number of the child objects. More... | |
int | childPos (const SUIT_DataObject *) const |
Get the index of the specified object in the child list. More... | |
void | moveChildPos (SUIT_DataObject *, int) |
Moves the child position from current to new one. More... | |
SUIT_DataObject * | childObject (const int) const |
Get child object by the specified index. More... | |
int | level () const |
Get the object level in the tree structure. More... | |
int | position () const |
Get the position of the data object in its parent's children list. More... | |
void | setPosition (int) |
Sets new position of the object in parent's list. More... | |
SUIT_DataObject * | nextBrother () const |
Get the next sibling data object in the children list. More... | |
SUIT_DataObject * | prevBrother () const |
Get the previous sibling data object in the children list. More... | |
bool | autoDeleteChildren () const |
Get "auto-delete children" flag. More... | |
virtual void | setAutoDeleteChildren (const bool) |
Set "auto-delete children" flag. More... | |
virtual void | children (DataObjectList &, const bool=false) const |
Get all children. More... | |
virtual DataObjectList | children (const bool=false) |
Get all children. . More... | |
void | appendChild (SUIT_DataObject *) |
Add new child object to the end of the children list. More... | |
virtual void | insertChild (SUIT_DataObject *, int) |
Insert new child object to the list of the children. More... | |
virtual void | removeChild (SUIT_DataObject *, const bool=false) |
Remove the specified child object reference. More... | |
bool | replaceChild (SUIT_DataObject *, SUIT_DataObject *, const bool=false) |
Replace the specified child object by another object. More... | |
void | reparentChildren (const SUIT_DataObject *) |
Change the parent for all children from specified object to this one. More... | |
virtual SUIT_DataObject * | parent () const |
Get the parent object. More... | |
virtual void | setParent (SUIT_DataObject *) |
Change the parent object. More... | |
virtual void | assignParent (SUIT_DataObject *) |
void | insertChildAtPos (SUIT_DataObject *obj, int position) |
Insert new child object into the list of the children (faster version of insertChild without signal). More... | |
bool | modified () |
virtual void | setModified (bool modified) |
Sets modification state of the object. More... | |
virtual QString | name () const |
Get data object name. More... | |
virtual QPixmap | icon (const int=NameId) const |
Get data object icon for the specified column. More... | |
virtual QString | toolTip (const int=NameId) const |
Get data object tooltip for the specified column. More... | |
virtual QString | statusTip (const int=NameId) const |
Get data object status tip for the specified column. More... | |
virtual QString | whatsThis (const int=NameId) const |
Get data object "what's this" information for the specified column. More... | |
virtual QFont | font (const int=NameId) const |
Get data object font for the specified column. More... | |
virtual int | alignment (const int=NameId) const |
Get data object text alignment for the specified column. More... | |
virtual bool | expandable () const |
virtual bool | isEnabled () const |
Check if this object is enabled. More... | |
virtual bool | isSelectable () const |
Check if this object is selectable. More... | |
virtual bool | isCheckable (const int=NameId) const |
Check if this object is checkable for the specified column. More... | |
virtual bool | isOn (const int=NameId) const |
Get the checked state of the object (if it is checkable) for the specified column. More... | |
virtual void | setOn (const bool, const int=NameId) |
Set the checked state of the object (if it is checkable) for the specified column. More... | |
virtual bool | isOpen () const |
Get the "opened" state of the object. More... | |
virtual void | setOpen (const bool) |
Set the "opened" state of the object. More... | |
virtual void | update () |
Updates necessary internal fields of data object. More... | |
void | deleteLater () |
Schedule this object for the late deleting. More... | |
void | dump (const int indent=2) const |
Dump the object tree recursively to the standard output. More... | |
Protected Attributes | |
QString | myCompDataType |
SUIT_DataObject * | myCompObject |
Additional Inherited Members | |
Static Public Member Functions inherited from SUIT_DataObject | |
static Signal * | signal () |
Get global signal handler. More... | |
static bool | connect (const char *, QObject *, const char *) |
Connect to the signal handlerx. More... | |
static bool | disconnect (const char *, QObject *, const char *) |
Disconnect from the signal handler. More... | |
LightApp_DataObject::LightApp_DataObject | ( | SUIT_DataObject * | parent = 0 | ) |
parent | parent data object |
|
virtual |
role | color role |
id | column id (not used) |
Reimplemented from SUIT_DataObject.
Reimplemented in SalomeApp_RootObject, SALOME_PYQT_BorrowedDataObjectLight, SALOME_PYQT_DataObjectLight, and SalomeApp_DataObject.
References SUIT_DataObject::color(), SUIT_DataObject::Foreground, SUIT_DataObject::Highlight, SUIT_DataObject::HighlightedText, isReference(), and SUIT_DataObject::Text.
|
virtual |
This method is called only for those columns for which customSorting() method returns true
.
left | first data to compare |
right | second data to compare |
id | column id |
Reimplemented from SUIT_DataObject.
Reimplemented in SalomeApp_DataObject.
References SUIT_DataObject::compare(), and EntryId.
|
virtual |
Reimplemented in SalomeApp_DataObject.
References componentObject(), CAM_ModuleObject::dataModel(), CAM_DataModel::module(), myCompDataType, and CAM_Module::name().
|
virtual |
References myCompObject, SUIT_DataObject::parent(), and SUIT_DataObject::root().
|
virtual |
Reimplemented from SUIT_DataObject.
References EntryId, and Qtx::IdType.
id | column id |
true
if column sorting should be customized Reimplemented from SUIT_DataObject.
Reimplemented in SalomeApp_DataObject.
References SUIT_DataObject::customSorting(), and EntryId.
|
virtual |
This method should be reimplemented in the subclasses. Default implementation returns null string.
Reimplemented in SalomeApp_SavePointObject, SalomeApp_RootObject, SalomeApp_DataObject, SALOME_PYQT_BorrowedDataObjectLight, and SALOME_PYQT_DataObjectLight.
|
virtual |
Groups of data objects are used for column information search. Each column of data model has one or several registered group id If object has the same group id as one of registered, the information will be shown; the custom id of column will be passed into data() method in order to identify column from point of view of data object
Reimplemented from SUIT_DataObject.
References CAM_DataObject::dataModel(), LightApp_DataModel::groupId(), and SUIT_DataObject::groupId().
|
virtual |
This method can be re-implemented in the subclasses.
true
if it is possible to drag this object Reimplemented from SUIT_DataObject.
References LightApp_Module::isDraggable(), and CAM_DataObject::module().
|
virtual |
This method can be re-implemented in the subclasses.
obj | object being dropped |
true
if it is possible to drop an object obj
to this object Reimplemented from SUIT_DataObject.
References LightApp_Module::isDropAccepted(), and CAM_DataObject::module().
|
virtual |
The base implementation retuns true, if refEntry() returns non-empty string.
Reimplemented in SalomeApp_DataObject.
References refEntry().
|
virtual |
true
if this object is displayable or false
otherwise Reimplemented from SUIT_DataObject.
Reimplemented in SalomeApp_DataObject.
References componentDataType(), LightApp_Study::getVisualComponentName(), SUIT_DataObject::root(), and LightApp_RootObject::study().
|
virtual |
|
virtual |
This method should be reimplemented in the subclasses. Default implementation returns null string.
Reimplemented in SalomeApp_DataObject, SALOME_PYQT_BorrowedDataObjectLight, and SALOME_PYQT_DataObjectLight.
This method can be re-implemented in the subclasses. Default implementation returns false
(all objects can not be renamed).
id | column id |
true
if the item can be renamed by the user in place (e.g. in the Object browser) Reimplemented from SUIT_DataObject.
References app, SUIT_Study::application(), entry(), CAM_DataObject::module(), SUIT_DataObject::NameId, LightApp_Module::renameAllowed(), SUIT_DataObject::renameAllowed(), LightApp_Application::renameAllowed(), SUIT_DataObject::root(), and LightApp_RootObject::study().
|
virtual |
This method can be re-implemented in the subclasses. Default implementation returns false
.
true
if rename operation finished successfully, false
otherwise. Reimplemented from SUIT_DataObject.
Reimplemented in SALOME_PYQT_BorrowedDataObjectLight, and SALOME_PYQT_DataObjectLight.
References app, SUIT_Study::application(), entry(), CAM_DataObject::module(), LightApp_Module::renameObject(), LightApp_Application::renameObject(), SUIT_DataObject::root(), SUIT_DataObject::setName(), and LightApp_RootObject::study().
Column with id == NameId is supposed to be used to get the object name. Column with id == EntryId is supposed to be used to get the object entry. Column with id == RefEntryId is supposed to be used to show the entry of the object referenced by this one.
id | column id |
Reimplemented from SUIT_DataObject.
Reimplemented in SalomeApp_RootObject, and SalomeApp_DataObject.
References entry(), EntryId, isReference(), refEntry(), RefEntryId, and SUIT_DataObject::text().
|
protected |
|
protected |