Version: 9.12.0
TreeModel Class Reference

#include <TreeModel.hxx>

Inheritance diagram for TreeModel:
Inheritance graph

Public Member Functions

 TreeModel (const QStringList &headers, QObject *parent=0)
 
 ~TreeModel ()
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
 
QModelIndex parent (const QModelIndex &index) const
 
int rowCount (const QModelIndex &parent=QModelIndex()) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 
bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole)
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
bool addData (DataObject *dataObject)
 
bool addData (DataObject *dataObject, const QStringList &path)
 
bool removeData (DataObject *dataObject)
 
TreeItemgetRootItem ()
 

Private Member Functions

TreeItemgetItem (const QModelIndex &index=QModelIndex()) const
 

Private Attributes

TreeItem_rootItem
 

Friends

class TreeItem
 
class TreeView
 

Constructor & Destructor Documentation

◆ TreeModel()

TreeModel::TreeModel ( const QStringList &  headers,
QObject parent = 0 
)

◆ ~TreeModel()

TreeModel::~TreeModel ( )

References _rootItem.

Member Function Documentation

◆ addData() [1/2]

bool TreeModel::addData ( DataObject dataObject)

◆ addData() [2/2]

bool TreeModel::addData ( DataObject dataObject,
const QStringList &  path 
)

◆ columnCount()

int TreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const

◆ data()

QVariant TreeModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

This function is used by the tree model to inform the tree view of what data used for rendering of the item in the different possible role (edition, ...).

References TreeItem::data(), getItem(), and index().

◆ flags()

Qt::ItemFlags TreeModel::flags ( const QModelIndex &  index) const

References index().

◆ getItem()

TreeItem * TreeModel::getItem ( const QModelIndex &  index = QModelIndex()) const
private

This retrieves the item asociated to the specified index.

References _rootItem, and index().

◆ getRootItem()

TreeItem * TreeModel::getRootItem ( )

References _rootItem.

◆ headerData()

QVariant TreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

◆ index()

QModelIndex TreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

This retrieves the index of the item located at (row,column) place relative to the parent specified by its index.

References TreeItem::child(), getItem(), and parent().

◆ parent()

QModelIndex TreeModel::parent ( const QModelIndex &  index) const

◆ removeData()

bool TreeModel::removeData ( DataObject dataObject)

◆ rowCount()

int TreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const

◆ setData()

bool TreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

◆ setHeaderData()

bool TreeModel::setHeaderData ( int  section,
Qt::Orientation  orientation,
const QVariant &  value,
int  role = Qt::EditRole 
)

Friends And Related Function Documentation

◆ TreeItem

friend class TreeItem
friend

◆ TreeView

friend class TreeView
friend

Member Data Documentation

◆ _rootItem

TreeItem* TreeModel::_rootItem
private

The documentation for this class was generated from the following files: