Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Constructor & Destructor Documentation

SUIT_TreeModel::TreeItem::TreeItem ( SUIT_DataObject obj,
SUIT_TreeModel::TreeItem parent = 0,
SUIT_TreeModel::TreeItem after = 0 
)
Parameters
objdata object
parentparent item
aftertree item after each this one should be inserted

References insertChild(), and myParent.

SUIT_TreeModel::TreeItem::~TreeItem ( )

Member Function Documentation

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::child ( const int  i)
Parameters
ichild item index
Returns
child item or 0 if i is out of range
int SUIT_TreeModel::TreeItem::childCount ( ) const
Returns
number of children
QList< SUIT_TreeModel::TreeItem * > SUIT_TreeModel::TreeItem::children ( ) const
Returns
list of child items
SUIT_DataObject * SUIT_TreeModel::TreeItem::dataObject ( ) const
Returns
data object this item is associated to
void SUIT_TreeModel::TreeItem::insertChild ( SUIT_TreeModel::TreeItem child,
SUIT_TreeModel::TreeItem after = 0 
)
Parameters
childchild item being inserted
aftertree item after each child should be inserted

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

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::nextSibling ( ) const
Returns
next sibling item or 0 if there are no any

References SUIT_TreeModel::parent().

SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::parent ( ) const
Returns
parent item
int SUIT_TreeModel::TreeItem::position ( ) const
Returns
item position
SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::prevSibling ( ) const
Returns
previous sibling item or 0 if there are no any

References SUIT_TreeModel::parent().

void SUIT_TreeModel::TreeItem::removeChild ( SUIT_TreeModel::TreeItem child)
Parameters
childchild item being removed
void SUIT_TreeModel::TreeItem::setPosition ( int  position)
inline

References _position, and position().

Member Data Documentation

int SUIT_TreeModel::TreeItem::_position
private
QList<TreeItem*> SUIT_TreeModel::TreeItem::myChildren
private
SUIT_DataObject* SUIT_TreeModel::TreeItem::myObj
private
TreeItem* SUIT_TreeModel::TreeItem::myParent
private

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