Item model for viewing Variables in a tree view.
More...
#include <ObjectHierarchyModel.h>
|
| ObjectHierarchyModel (bool multi, QObject *parent) |
| Constructor.
|
|
| ~ObjectHierarchyModel () override |
| Overridden destructor.
|
|
QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
| Overridden from base class to provide column display names.
|
|
int | columnCount (const QModelIndex &parent) const override |
| Overridden from base class to provide the amount of columns.
|
|
int | rowCount (const QModelIndex &parent) const override |
| Overridden from base class to provide the amount of rows.
|
|
QVariant | data (const QModelIndex &index, int role) const override |
| Overridden from base class to provide the data to present.
|
|
Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Overridden from base class to provide flags on an item by index.
|
|
QModelIndex | index (int row, int column, const QModelIndex &parent) const override |
| Overridden from base class.
|
|
QModelIndex | parent (const QModelIndex &child) const override |
| Overridden from base class.
|
|
void | toggleSelection (const QModelIndex &index) |
| Toggle the selection of the item at the passed index.
|
|
QObject * | getObject (QModelIndex index) const |
| Gets the current item from the tree.
|
|
void | updateList (QObject *root) |
| Updates the list data using the passed object as root.
|
|
bool | insertItemAt (const QModelIndex &parent, QObject *obj) |
| Inserts an object at the index.
|
|
void | removeItem (const QModelIndex &index) |
| removes item at passed index.
|
|
bool | isRoot (QModelIndex index) const |
| Determines if this is the root item.
|
|
QModelIndex | getObjectIndex (QObject *obj) |
| Gets the model-index from the passed object.
|
|
Item model for viewing Variables in a tree view.
◆ ObjectHierarchyModel()
sf::ObjectHierarchyModel::ObjectHierarchyModel |
( |
bool |
multi, |
|
|
QObject * |
parent |
|
) |
| |
|
explicit |
◆ ~ObjectHierarchyModel()
sf::ObjectHierarchyModel::~ObjectHierarchyModel |
( |
| ) |
|
|
override |
◆ columnCount()
int sf::ObjectHierarchyModel::columnCount |
( |
const QModelIndex & |
parent | ) |
const |
|
override |
Overridden from base class to provide the amount of columns.
◆ data()
QVariant sf::ObjectHierarchyModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
override |
Overridden from base class to provide the data to present.
◆ flags()
Qt::ItemFlags sf::ObjectHierarchyModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
override |
Overridden from base class to provide flags on an item by index.
◆ getObject()
QObject * sf::ObjectHierarchyModel::getObject |
( |
QModelIndex |
index | ) |
const |
Gets the current item from the tree.
- Returns
- When no current item nullptr.
◆ getObjectIndex()
QModelIndex sf::ObjectHierarchyModel::getObjectIndex |
( |
QObject * |
obj | ) |
|
Gets the model-index from the passed object.
◆ headerData()
QVariant sf::ObjectHierarchyModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role |
|
) |
| const |
|
override |
Overridden from base class to provide column display names.
◆ index()
QModelIndex sf::ObjectHierarchyModel::index |
( |
int |
row, |
|
|
int |
column, |
|
|
const QModelIndex & |
parent |
|
) |
| const |
|
override |
Overridden from base class.
◆ insertItemAt()
bool sf::ObjectHierarchyModel::insertItemAt |
( |
const QModelIndex & |
parent, |
|
|
QObject * |
obj |
|
) |
| |
Inserts an object at the index.
- Parameters
-
parent | Index of the parent in the tree. |
obj | New child object of the parent indicated by the index. |
- Returns
- True wen parentIndex indeed points to the objects parent object.
◆ isRoot()
bool sf::ObjectHierarchyModel::isRoot |
( |
QModelIndex |
index | ) |
const |
Determines if this is the root item.
◆ parent()
QModelIndex sf::ObjectHierarchyModel::parent |
( |
const QModelIndex & |
child | ) |
const |
|
override |
Overridden from base class.
◆ removeItem()
void sf::ObjectHierarchyModel::removeItem |
( |
const QModelIndex & |
index | ) |
|
removes item at passed index.
◆ rowCount()
int sf::ObjectHierarchyModel::rowCount |
( |
const QModelIndex & |
parent | ) |
const |
|
override |
Overridden from base class to provide the amount of rows.
◆ toggleSelection()
void sf::ObjectHierarchyModel::toggleSelection |
( |
const QModelIndex & |
index | ) |
|
Toggle the selection of the item at the passed index.
◆ updateList()
void sf::ObjectHierarchyModel::updateList |
( |
QObject * |
root | ) |
|
Updates the list data using the passed object as root.
The documentation for this class was generated from the following file: