ITreeModel#
Tree model.
Header: | #include <AUI/Model/ITreeModel.h> |
CMake: | aui_link(my_target PUBLIC aui::core) |
Detailed Description#
ITreeModel is an interface to a tree data structure used for ATreeView.
Basic implementation of the tree model is available in ATreeModel.
Public fields and Signals#
dataChanged#
emits<ATreeModelIndex> dataChanged
Model data was changed
dataInserted#
emits<ATreeModelIndex> dataInserted
Model data was added
Examples#
examples/ui/views/src/DemoListModel.cpp
Views Example - All-in-one views building example.
}
void DemoListModel::addItem() {
mListSize += 1;
emit dataInserted(range({mListSize - 1}));
}
void DemoListModel::removeItem() {
if (mListSize > 0) {
mListSize -= 1;
dataRemoved#
emits<ATreeModelIndex> dataRemoved
Model data about to remove
Examples#
Public Methods#
childrenCount#
Count of children of the vertex.
- Arguments
vertex
the vertex to determine the children count of
indexOfChild#
virtual ATreeModelIndex ITreeModel::indexOfChild(size_t row, size_t column, const ATreeModelIndexOrRoot& vertex)
Creates valid ATreeModelIndex of the child.
- Arguments
- Returns
- The child of the parent index with specified row and column.
itemAt#
virtual T ITreeModel::itemAt(const ATreeModelIndex& index)
value representation, used by ATreeView.
parent#
virtual ATreeModelIndexOrRoot ITreeModel::parent(const ATreeModelIndex& vertex)
Creates index of parent vertex of the specified vertex.
Examples#
examples/ui/views/tests/LayoutManagerTest.cpp
Views Example - All-in-one views building example.