Functor class for synchronizing data tree and tree model when the data tree is changed outside the model.
Public Member Functions | |
| TreeSync (SUIT_TreeModel *) | |
| Constructor. | |
| bool | isEqual (const ObjPtr &, const ItemPtr &) const |
| Check if item corresponds to the specified data object. | |
| ObjPtr | nullSrc () const |
| Get null data object. | |
| ItemPtr | nullTrg () const |
| Get null tree item. | |
| ItemPtr | createItem (const ObjPtr &, const ItemPtr &, const ItemPtr &) const |
| Create an item corresponding to the specified data object. | |
| void | updateItem (const ObjPtr &, const ItemPtr &) const |
| Update tree item. | |
| void | deleteItemWithChildren (const ItemPtr &) const |
| Delete item with all children recursively. | |
| QList< ObjPtr > | children (const ObjPtr &) const |
| Get all the children of the specified data object. | |
| QList< ItemPtr > | children (const ItemPtr &) const |
| Get all the children of the specified tree item. | |
| ItemPtr | parent (const ItemPtr &) const |
| Get item which is the parent for the specified item. | |
Private Member Functions | |
| bool | needUpdate (const ItemPtr &) const |
| Check if the tree item needs updating. | |
Private Attributes | |
| SUIT_TreeModel * | myModel |
| SUIT_TreeModel.TreeSync::TreeSync | ( | SUIT_TreeModel * | model | ) |
| model | tree model |
| obj | data object |
| item | tree item |
true if item corresponds to the data object References SUIT_TreeModel.TreeItem.dataObject(), PyInterp.obj, and SUIT_DataObject.root().
| SUIT_TreeModel::ObjPtr SUIT_TreeModel.TreeSync::nullSrc | ( | ) | const |
| SUIT_TreeModel::ItemPtr SUIT_TreeModel.TreeSync::nullTrg | ( | ) | const |
| SUIT_TreeModel::ItemPtr SUIT_TreeModel.TreeSync::createItem | ( | const ObjPtr & | obj, |
| const ItemPtr & | parent, | ||
| const ItemPtr & | after | ||
| ) | const |
| obj | data object |
| parent | parent tree item |
| after | tree item after each new one should be inserted |
References SUIT_DataObject.update().
| obj | reference data object |
| item | tree item to be updated |
References SUIT_DataObject.update().
| void SUIT_TreeModel.TreeSync::deleteItemWithChildren | ( | const ItemPtr & | item | ) | const |
| item | tree item |
| QList< SUIT_TreeModel::ObjPtr > SUIT_TreeModel.TreeSync::children | ( | const ObjPtr & | obj | ) | const |
| QList< SUIT_TreeModel::ItemPtr > SUIT_TreeModel.TreeSync::children | ( | const ItemPtr & | item | ) | const |
| item | tree item |
References SUIT_TreeModel.TreeItem.children().
| SUIT_TreeModel::ItemPtr SUIT_TreeModel.TreeSync::parent | ( | const ItemPtr & | item | ) | const |
| bool SUIT_TreeModel.TreeSync::needUpdate | ( | const ItemPtr & | item | ) | const [private] |
| item | tree item to be checked |
true if item needs updatingReferences SUIT_TreeModel.TreeItem.dataObject(), and PyInterp.obj.
SUIT_TreeModel* SUIT_TreeModel.TreeSync.myModel [private] |