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_DataObject * | dataObject () const |
Get data object. More... | |
TreeItem * | parent () 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... | |
TreeItem * | child (const int i) |
Get child item by specified index. More... | |
QList< TreeItem * > | children () const |
Get all child items. More... | |
TreeItem * | nextSibling () const |
Get next sibling item. More... | |
TreeItem * | prevSibling () const |
Get previous sibling item. More... | |
Private Attributes | |
TreeItem * | myParent |
QList< TreeItem * > | myChildren |
SUIT_DataObject * | myObj |
int | _position |
SUIT_TreeModel::TreeItem::TreeItem | ( | SUIT_DataObject * | obj, |
SUIT_TreeModel::TreeItem * | parent = 0 , |
||
SUIT_TreeModel::TreeItem * | after = 0 |
||
) |
obj | data object |
parent | parent item |
after | tree item after each this one should be inserted |
References insertChild(), and myParent.
SUIT_TreeModel::TreeItem::~TreeItem | ( | ) |
SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::child | ( | const int | i | ) |
i | child item index |
int SUIT_TreeModel::TreeItem::childCount | ( | ) | const |
QList< SUIT_TreeModel::TreeItem * > SUIT_TreeModel::TreeItem::children | ( | ) | const |
SUIT_DataObject * SUIT_TreeModel::TreeItem::dataObject | ( | ) | const |
void SUIT_TreeModel::TreeItem::insertChild | ( | SUIT_TreeModel::TreeItem * | child, |
SUIT_TreeModel::TreeItem * | after = 0 |
||
) |
child | child item being inserted |
after | tree item after each child should be inserted |
References SUIT_TreeModel::index(), and position().
SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::nextSibling | ( | ) | const |
References SUIT_TreeModel::parent().
SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::parent | ( | ) | const |
int SUIT_TreeModel::TreeItem::position | ( | ) | const |
SUIT_TreeModel::TreeItem * SUIT_TreeModel::TreeItem::prevSibling | ( | ) | const |
References SUIT_TreeModel::parent().
void SUIT_TreeModel::TreeItem::removeChild | ( | SUIT_TreeModel::TreeItem * | child | ) |
child | child item being removed |
|
inline |
References _position, and position().
|
private |
|
private |
|
private |