QtAstModel Class Reference

A ModelView class which represents the data in an AST. More...

#include <QtAstModel.h>

List of all members.

Public Slots

void setNode (SgNode *node)
 Set new root of the tree.
void setFilter (AstFilterInterface *filter)

Public Member Functions

 QtAstModel (SgNode *node, QObject *parent=0)
virtual ~QtAstModel ()
virtual Qt::ItemFlags flags (const QModelIndex &index) const
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
virtual QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
virtual QModelIndex parent (const QModelIndex &index) const
virtual SgNode * getNodeFromIndex (const QModelIndex &ind)

Protected Attributes

ModelNodetreeRoot
AstFilterInterfacefilter

Classes

class  ModelNode
 Node for a tree consisting of DisplayInformation of an Ast. More...


Detailed Description

A ModelView class which represents the data in an AST.

If you are not familiar with the Qt Model-View interfaces see the Qt-documentation for QAbstractItemModel

The data are fetched from the AST on demand while the user browses through it so the model is build up on demand

There is a second tree build up (out of ModelNodes) which just holds the display-information but usually this display-tree is smaller than the whole AST because it's build up on demand

Definition at line 23 of file QtAstModel.h.


Constructor & Destructor Documentation

QtAstModel::QtAstModel ( SgNode *  node,
QObject *  parent = 0 
)

Definition at line 146 of file QtAstModel.cpp.

QtAstModel::~QtAstModel (  )  [virtual]

Definition at line 152 of file QtAstModel.cpp.


Member Function Documentation

int QtAstModel::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const [virtual]

Definition at line 211 of file QtAstModel.cpp.

Referenced by index().

Here is the caller graph for this function:

QVariant QtAstModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const [virtual]

Definition at line 186 of file QtAstModel.cpp.

Here is the call graph for this function:

Qt::ItemFlags QtAstModel::flags ( const QModelIndex &  index  )  const [virtual]

Definition at line 178 of file QtAstModel.cpp.

SgNode * QtAstModel::getNodeFromIndex ( const QModelIndex &  ind  )  [virtual]

Should not be used any more, query for the SgNodeRole of an index

Warning:
may return NULL!

Definition at line 307 of file QtAstModel.cpp.

Here is the call graph for this function:

QVariant QtAstModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const [virtual]

Definition at line 197 of file QtAstModel.cpp.

QModelIndex QtAstModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const [virtual]

Definition at line 259 of file QtAstModel.cpp.

Here is the call graph for this function:

QModelIndex QtAstModel::parent ( const QModelIndex &  index  )  const [virtual]

Definition at line 288 of file QtAstModel.cpp.

Here is the call graph for this function:

int QtAstModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const [virtual]

Definition at line 216 of file QtAstModel.cpp.

Referenced by index().

Here is the call graph for this function:

Here is the caller graph for this function:

void QtAstModel::setFilter ( AstFilterInterface filter  )  [slot]

Tree can be filtered by ASTFilterInterface Deletion of filter is done by this class set to NULL, for unfiltered view

Definition at line 160 of file QtAstModel.cpp.

Referenced by AstBrowserWidget::setFilter().

void QtAstModel::setNode ( SgNode *  node  )  [slot]

Set new root of the tree.

Definition at line 171 of file QtAstModel.cpp.

Referenced by AstBrowserWidget::setNode().


Member Data Documentation

AstFilterInterface* QtAstModel::filter [protected]

Definition at line 59 of file QtAstModel.h.

Referenced by rowCount(), setFilter(), and ~QtAstModel().

ModelNode* QtAstModel::treeRoot [protected]

Definition at line 58 of file QtAstModel.h.

Referenced by index(), parent(), QtAstModel(), setFilter(), setNode(), and ~QtAstModel().


The documentation for this class was generated from the following files:
Generated on Tue Sep 15 14:48:50 2009 for RoseQtWidgets by  doxygen 1.4.7