TreeModel Class | Extending Qt Creator Manual

Extending Qt Creator Manual | TreeModel

Extending Qt Creator Manual 4.6.0

# TreeModel Class

(Utils::TreeModel)

The TreeModel class is a convienience base class for models to use in a QTreeView. More...

Header: | #include <TreeModel>
Inherits: | Utils::BaseTreeModel

- List of all members, including inherited members

## Public Functions

| TreeModel(QObject *parent = 0)
| TreeModel(RootItem *root, QObject *parent = 0)
Internal::SelectType<Level, LevelItemTypes...>::Type * | findItemAtLevel(const Predicate &pred) const
BestItem * | findNonRootItem(const Predicate &pred) const
void | forAllItems(const Predicate &pred) const
void | forItemsAtLevel(const Predicate &pred) const
void | forSelectedItems(const Predicate &pred) const
BestItem * | itemForIndex(const QModelIndex &idx) const
Internal::SelectType<Level, LevelItemTypes...>::Type * | itemForIndexAtLevel(const QModelIndex &idx) const
BestItem * | nonRootItemForIndex(const QModelIndex &idx) const
RootItem * | rootItem() const

### Additional Inherited Members

- 1 signal inherited from Utils::BaseTreeModel
- 21 protected functions inherited from Utils::BaseTreeModel

## Detailed Description

The TreeModel class is a convienience base class for models to use in a QTreeView.

## Member Function Documentation

### TreeModel::TreeModel(QObject *parent = 0)

Default constructs an instance of TreeModel.

### TreeModel::TreeModel(RootItem *root, QObject *parent = 0)

Default constructs an instance of TreeModel.

### Internal::SelectType<Level, LevelItemTypes...>::Type *TreeModel::findItemAtLevel(const Predicate &pred) const

### BestItem *TreeModel::findNonRootItem(const Predicate &pred) const

### void TreeModel::forAllItems(const Predicate &pred) const

### void TreeModel::forItemsAtLevel(const Predicate &pred) const

### void TreeModel::forSelectedItems(const Predicate &pred) const

### BestItem *TreeModel::itemForIndex(const QModelIndex &idx) const

### Internal::SelectType<Level, LevelItemTypes...>::Type *TreeModel::itemForIndexAtLevel(const QModelIndex &idx) const

### BestItem *TreeModel::nonRootItemForIndex(const QModelIndex &idx) const

### RootItem *TreeModel::rootItem() const