Version: 9.12.0
SUIT_TreeModel::TreeItem Class Reference

Internal class used for tree view synchronizaton with data object tree. More...

Public Member Functions

 TreeItem (SUIT_DataObject *obj, TreeItem *parent=0, TreeItem *after=0)
 Constructor. More...
 
 ~TreeItem ()
 Destructor. Deletes all child items recursively. More...
 
void insertChild (TreeItem *child, TreeItem *after=0)
 Insert child item. More...
 
void removeChild (TreeItem *child)
 Remove child item. More...
 
SUIT_DataObjectdataObject () const
 Get data object. More...
 
TreeItemparent () const
 Get parent item. More...
 
int position () const
 Get position of this item in its parent's children list. More...
 
void setPosition (int position)
 
int childCount () const
 Get number of child items. More...
 
TreeItemchild (const int i)
 Get child item by specified index. More...
 
QList< TreeItem * > children () const
 Get all child items. More...
 
TreeItemnextSibling () const
 Get next sibling item. More...
 
TreeItemprevSibling () const
 Get previous sibling item. More...
 

Private Attributes

TreeItemmyParent
 
QList< TreeItem * > myChildren
 
SUIT_DataObjectmyObj
 
int _position
 

Detailed Description

Internal class used for tree view synchronizaton with data object tree.

Constructor & Destructor Documentation

◆ TreeItem()

SUIT_TreeModel::TreeItem::TreeItem ( SUIT_DataObject obj,
SUIT_TreeModel::TreeItem parent = 0,
SUIT_TreeModel::TreeItem after = 0 
)

Constructor.

Parameters
objdata object
parentparent item
aftertree item after each this one should be inserted

References insertChild(), and myParent.

◆ ~TreeItem()

SUIT_TreeModel::TreeItem::~TreeItem ( )

Destructor. Deletes all child items recursively.

Member Function Documentation

◆ child()

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::child ( const int  i)

Get child item by specified index.

Parameters
ichild item index
Returns
child item or 0 if i is out of range

◆ childCount()

int SUIT_TreeModel::TreeItem::childCount ( ) const

Get number of child items.

Returns
number of children

◆ children()

QList< SUIT_TreeModel::TreeItem * > SUIT_TreeModel::TreeItem::children ( ) const

Get all child items.

Returns
list of child items

◆ dataObject()

SUIT_DataObject * SUIT_TreeModel::TreeItem::dataObject ( ) const

Get data object.

Returns
data object this item is associated to

◆ insertChild()

void SUIT_TreeModel::TreeItem::insertChild ( SUIT_TreeModel::TreeItem child,
SUIT_TreeModel::TreeItem after = 0 
)

Insert child item.

Parameters
childchild item being inserted
aftertree item after each child should be inserted

References SUIT_TreeModel::index(), and position().

◆ nextSibling()

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::nextSibling ( ) const

Get next sibling item.

Returns
next sibling item or 0 if there are no any

References SUIT_TreeModel::parent().

◆ parent()

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::parent ( ) const

Get parent item.

Returns
parent item

◆ position()

int SUIT_TreeModel::TreeItem::position ( ) const

Get position of this item in its parent's children list.

Returns
item position

◆ prevSibling()

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::prevSibling ( ) const

Get previous sibling item.

Returns
previous sibling item or 0 if there are no any

References SUIT_TreeModel::parent().

◆ removeChild()

void SUIT_TreeModel::TreeItem::removeChild ( SUIT_TreeModel::TreeItem child)

Remove child item.

Parameters
childchild item being removed

◆ setPosition()

void SUIT_TreeModel::TreeItem::setPosition ( int  position)
inline

References _position, and position().

Member Data Documentation

◆ _position

int SUIT_TreeModel::TreeItem::_position
private

◆ myChildren

QList<TreeItem*> SUIT_TreeModel::TreeItem::myChildren
private

◆ myObj

SUIT_DataObject* SUIT_TreeModel::TreeItem::myObj
private

◆ myParent

TreeItem* SUIT_TreeModel::TreeItem::myParent
private

The documentation for this class was generated from the following file: