Signals | Public Member Functions | List of all members
pqDataAssemblyTreeModel Class Reference

QAbstractItemModel implementation for vtkDataAssembly. More...

#include <pqDataAssemblyTreeModel.h>

Inherits QAbstractItemModel.

Signals

void modelDataChanged (int role)
 This signal is fired in setData if the data is changed. More...
 

Public Member Functions

 pqDataAssemblyTreeModel (QObject *parent=nullptr)
 
 ~pqDataAssemblyTreeModel () override
 
void setDataAssembly (vtkDataAssembly *assembly)
 Get/Set the vtkDataAssembly to represent in this model. More...
 
vtkDataAssembly * dataAssembly () const
 
void setUserCheckable (bool)
 Get whether the model is user-checkable. More...
 
bool userCheckable () const
 Get whether the model is user-checkable. More...
 
void setCheckedNodes (const QStringList &paths)
 Get/Set the check state for Qt::Checked for nodes selected using the path names specified. More...
 
QStringList checkedNodes () const
 Get/Set the check state for Qt::Checked for nodes selected using the path names specified. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 QAbstractItemModel interface implementation. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 QAbstractItemModel interface implementation. More...
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 QAbstractItemModel interface implementation. More...
 
QModelIndex parent (const QModelIndex &index=QModelIndex()) const override
 QAbstractItemModel interface implementation. More...
 
QVariant data (const QModelIndex &index, int role) const override
 QAbstractItemModel interface implementation. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 QAbstractItemModel interface implementation. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 QAbstractItemModel interface implementation. More...
 

Detailed Description

QAbstractItemModel implementation for vtkDataAssembly.

pqDataAssemblyTreeModel builds a tree-model from a vtkDataAssembly. The vtkDataAssembly to shown is set using setDataAssembly. To allow user-settable check-states, use setUserCheckable(true). The model doesn't support any additional custom properties. One is expected to use a proxy model to store additional meta-data associated with nodes.

Definition at line 51 of file pqDataAssemblyTreeModel.h.

Constructor & Destructor Documentation

◆ pqDataAssemblyTreeModel()

pqDataAssemblyTreeModel::pqDataAssemblyTreeModel ( QObject *  parent = nullptr)

◆ ~pqDataAssemblyTreeModel()

pqDataAssemblyTreeModel::~pqDataAssemblyTreeModel ( )
override

Member Function Documentation

◆ setDataAssembly()

void pqDataAssemblyTreeModel::setDataAssembly ( vtkDataAssembly *  assembly)

Get/Set the vtkDataAssembly to represent in this model.

◆ dataAssembly()

vtkDataAssembly* pqDataAssemblyTreeModel::dataAssembly ( ) const

◆ setUserCheckable()

void pqDataAssemblyTreeModel::setUserCheckable ( bool  )

Get whether the model is user-checkable.

◆ userCheckable()

bool pqDataAssemblyTreeModel::userCheckable ( ) const
inline

Get whether the model is user-checkable.

Definition at line 71 of file pqDataAssemblyTreeModel.h.

◆ setCheckedNodes()

void pqDataAssemblyTreeModel::setCheckedNodes ( const QStringList &  paths)

Get/Set the check state for Qt::Checked for nodes selected using the path names specified.

Note
checking a node causes all it child nodes to be checked as well.
checkedNodes() may not returns exactly the same paths passed to setCheckedNodes even if the check-states were not changed in between the two calls.
See also
vtkDataAssembly::SelectNodes

◆ checkedNodes()

QStringList pqDataAssemblyTreeModel::checkedNodes ( ) const

Get/Set the check state for Qt::Checked for nodes selected using the path names specified.

Note
checking a node causes all it child nodes to be checked as well.
checkedNodes() may not returns exactly the same paths passed to setCheckedNodes even if the check-states were not changed in between the two calls.
See also
vtkDataAssembly::SelectNodes

◆ columnCount()

int pqDataAssemblyTreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

QAbstractItemModel interface implementation.

◆ rowCount()

int pqDataAssemblyTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

QAbstractItemModel interface implementation.

◆ index()

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

QAbstractItemModel interface implementation.

◆ parent()

QModelIndex pqDataAssemblyTreeModel::parent ( const QModelIndex &  index = QModelIndex()) const
override

QAbstractItemModel interface implementation.

◆ data()

QVariant pqDataAssemblyTreeModel::data ( const QModelIndex &  index,
int  role 
) const
override

QAbstractItemModel interface implementation.

◆ flags()

Qt::ItemFlags pqDataAssemblyTreeModel::flags ( const QModelIndex &  index) const
override

QAbstractItemModel interface implementation.

◆ setData()

bool pqDataAssemblyTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

QAbstractItemModel interface implementation.

◆ modelDataChanged

void pqDataAssemblyTreeModel::modelDataChanged ( int  role)
signal

This signal is fired in setData if the data is changed.

setData can result in multiple calls to dataChanged signal as the data is updated on nodes in the hierarchy. This signal is fired only once for setData call irrespective of how many internal nodes are updated.


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