Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ( const QStringList &  headers,
QObject parent = 0 
)
TreeModel::~TreeModel ( )

References _rootItem.

Member Function Documentation

bool TreeModel::addData ( DataObject dataObject)
bool TreeModel::addData ( DataObject dataObject,
const QStringList &  path 
)
int TreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
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(), and getItem().

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

This retrieves the item asociated to the specified index.

References _rootItem.

TreeItem * TreeModel::getRootItem ( )

References _rootItem.

QVariant TreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
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(), and getItem().

QModelIndex TreeModel::parent ( const QModelIndex &  index) const
bool TreeModel::removeData ( DataObject dataObject)
int TreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
bool TreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

References getItem(), and TreeItem::setData().

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

Friends And Related Function Documentation

friend class TreeItem
friend
friend class TreeView
friend

Member Data Documentation

TreeItem* TreeModel::_rootItem
private

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