TreeModel Class Reference

Model managing the data structure of the tree. More...

#include <treemodel.h>

List of all members.

Public Slots

void requestExpansion (const QModelIndex &index)
void updateCurrent (const QModelIndex &index)
void deleteChildren (const QModelIndex &index)
void updateFilter (QString expression)
int updateChildren (const QModelIndex &index)


void filterChanged (QString)
void invalidFilter ()
void work ()

Public Member Functions

 TreeModel (const QString &data, const ProgramLoader &programLoader, TreeView *view, QObject *parent=0)
TreeItemitem (const QModelIndex &index) const
TreeItemcurrentTreeFileItem ()
virtual QVariant data (const QModelIndex &index, int role) const final
virtual Qt::ItemFlags flags (const QModelIndex &index) const final
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const final
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const final
virtual QModelIndex parent (const QModelIndex &index) const final
virtual int realRowCount (const QModelIndex &parent=QModelIndex()) const final
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const final
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const final
QModelIndex addFile (File *file, const Module &module)
virtual bool removeRows (int position, int rows, const QModelIndex &parent) override
void removeItem (QModelIndex index)
int populate (const QModelIndex &index, unsigned int nominalCount, unsigned int minCount, unsigned int maxTries)
QString rootPath ()
QString path (QModelIndex index) const
quint64 position (QModelIndex index) const
quint64 size (QModelIndex index) const
void updateByFilePosition (quint64 pos)

Public Attributes


Detailed Description

Model managing the data structure of the tree.

The items populating the tree are instances of TreeObjectItem and is directly linked with an instance of Object. The exception being the root item which is merely an instance of TreeItem.

The model uses lazy population. This means that the model waits that a node get expanded to populate its children. This also means that when there is a large number of children only a limited number are added, and the rest is then added progressively.

Constructor & Destructor Documentation

TreeModel::TreeModel ( const QString &  data,
const ProgramLoader programLoader,
TreeView view,
QObject *  parent = 0 

Member Function Documentation

QModelIndex TreeModel::addFile ( File file,
const Module module 
virtual int TreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]
virtual QVariant TreeModel::data ( const QModelIndex &  index,
int  role 
) const [virtual]
void TreeModel::deleteChildren ( const QModelIndex &  index) [slot]
void TreeModel::filterChanged ( QString  ) [signal]
virtual Qt::ItemFlags TreeModel::flags ( const QModelIndex &  index) const [virtual]
virtual QVariant TreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const [virtual]
virtual QModelIndex TreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const [virtual]
void TreeModel::invalidFilter ( ) [signal]
TreeItem& TreeModel::item ( const QModelIndex &  index) const
virtual QModelIndex TreeModel::parent ( const QModelIndex &  index) const [virtual]
QString TreeModel::path ( QModelIndex  index) const
int TreeModel::populate ( const QModelIndex &  index,
unsigned int  nominalCount,
unsigned int  minCount,
unsigned int  maxTries 
quint64 TreeModel::position ( QModelIndex  index) const
virtual int TreeModel::realRowCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]
void TreeModel::removeItem ( QModelIndex  index)
virtual bool TreeModel::removeRows ( int  position,
int  rows,
const QModelIndex &  parent 
) [override, virtual]
void TreeModel::requestExpansion ( const QModelIndex &  index) [slot]
QString TreeModel::rootPath ( )
virtual int TreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const [virtual]
quint64 TreeModel::size ( QModelIndex  index) const
void TreeModel::updateByFilePosition ( quint64  pos)
int TreeModel::updateChildren ( const QModelIndex &  index) [slot]
void TreeModel::updateCurrent ( const QModelIndex &  index) [slot]
void TreeModel::updateFilter ( QString  expression) [slot]
void TreeModel::work ( ) [signal]

Member Data Documentation

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