COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Model that maintains properties for the node pointed by the index returned by NTree::global()->currentIndex()
. This class is a view for the tree model and is automatically updated whenever the current index is changed.
More...
#include <PropertyModel.hpp>
Inherits QAbstractItemModel.
Public Member Functions | |
PropertyModel () | |
Constructor. More... | |
virtual QVariant | data (const QModelIndex &index, int role) const |
Destructor. More... | |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
Implementation of QAbstractItemModel::index() . More... | |
virtual QModelIndex | parent (const QModelIndex &child) const |
Implementation of QAbstractItemModel::parent()-> More... | |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Implementation of QAbstractItemModel::rowCount() . More... | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
Implementation of QAbstractItemModel::columnCount() . More... | |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
Gives header titles. More... | |
Private Slots | |
void | current_index_changed (const QModelIndex &newIndex, const QModelIndex &oldIndex) |
Slot called when the current index has changed in the tree model. More... | |
Private Member Functions | |
void | empty_list () |
Clean the model data. More... | |
Private Attributes | |
QList< PropertyItem * > | m_data |
Model data. More... | |
QStringList | m_columns |
List of column headers. More... | |
Model that maintains properties for the node pointed by the index returned by NTree::global()->currentIndex()
. This class is a view for the tree model and is automatically updated whenever the current index is changed.
Definition at line 53 of file PropertyModel.hpp.
PropertyModel | ( | ) |
Constructor.
Definition at line 19 of file PropertyModel.cpp.
|
virtual |
Implementation of QAbstractItemModel::columnCount()
.
Definition at line 99 of file PropertyModel.cpp.
|
privateslot |
Slot called when the current index has changed in the tree model.
newIndex | New current index. |
oldIndex | Old current index. |
Definition at line 118 of file PropertyModel.cpp.
|
virtual |
Destructor.
Frees all allocated memory. Implementation of QAbstractItemModel::data()
. Only the role Qt::DisplayRole
is accepted. Other roles will result to the return of an empty QVariant
object (built with the default construtor).
index | Concerned item index. |
role | Role of the returned value (only Qt::DisplayRole ). |
Qt::DecorationRole
or if the index is not valid. Otherwise, returns the nodename of the item at the specified index. Definition at line 39 of file PropertyModel.cpp.
|
private |
Clean the model data.
Definition at line 141 of file PropertyModel.cpp.
|
virtual |
Gives header titles.
Overrides QAbstractItemModel::headerData()
.
section | Section number. |
orientation | Header orientation. |
role | Data role. Only Qt::DisplayRole is accepted. |
QVariant
on error. Definition at line 106 of file PropertyModel.cpp.
|
virtual |
Implementation of QAbstractItemModel::index()
.
Gives the index of the item at the given row and column under the given parent. If the parent index is not valid, the root item is taken as parent.
row | Item row from the parent. |
column | Item column. |
parent | Item parent. |
hasIndex(row, column, parent)
returns false
. Definition at line 63 of file PropertyModel.cpp.
|
virtual |
Implementation of QAbstractItemModel::parent()->
child | Item index of which we would like to know the parent. |
Definition at line 82 of file PropertyModel.cpp.
|
virtual |
Implementation of QAbstractItemModel::rowCount()
.
If the parent index is not valid, the root item is taken as parent.
Definition at line 89 of file PropertyModel.cpp.
|
private |
List of column headers.
Definition at line 134 of file PropertyModel.hpp.
|
private |
Model data.
Definition at line 131 of file PropertyModel.hpp.
Send comments to: COOLFluiD Web Admin |