TreeModel Class | Extending Qt Creator Manual

Extending Qt Creator Manual | TreeModel

Extending Qt Creator Manual 4.7.0

# TreeModel Class

(Utils::TreeModel)

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

Header: | #include <TreeModel>

- List of all members, including inherited members

## Public Types

typedef | BestItem
typedef | RootItem

## Public Functions

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

## Detailed Description

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

## Member Type Documentation

### typedef TreeModel::BestItem

### typedef TreeModel::RootItem

## Member Function Documentation

### TreeModel::TreeModel(int *parent = nullptr)

Default constructs an instance of TreeModel.

### TreeModel::TreeModel(Utils::TreeModel::RootItem *root, int *parent = nullptr)

Default constructs an instance of TreeModel.

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

### Utils::TreeModel::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

### Utils::TreeModel::BestItem *TreeModel::itemForIndex(const int &idx) const

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

### Utils::TreeModel::BestItem *TreeModel::nonRootItemForIndex(const int &idx) const

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