![]() |
COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Model that handles modified options details. More...
#include <CommitDetails.hpp>
Inherits QAbstractItemModel.
Public Member Functions | |
| CommitDetails (QObject *parent=nullptr, const QString &node_path=QString()) | |
| Constructor. More... | |
| QVariant | data (const QModelIndex &index, int role) const |
| Implements QAbstractItemModel::data() More... | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| Reimplements QAbstractItemModel::headerData() More... | |
| QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
| Implements QAbstractItemModel::index() More... | |
| QModelIndex | parent (const QModelIndex &index) const |
| Implements QAbstractItemModel::parent() More... | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| Implements QAbstractItemModel::rowCount() More... | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| Implements QAbstractItemModel::columnCount() More... | |
| void | set_option (const QString &optionName, const QString &oldValue, const QString ¤tValue) |
| Sets a option. More... | |
| QString | node_path () const |
| Gives the node path. More... | |
| void | set_node_path (const QString &node_path) |
| Sets the node path. More... | |
| bool | has_options () const |
| Checks whether the internal container has options. More... | |
| void | clear () |
| Removes all options and clears the node path. More... | |
Private Attributes | |
| QString | m_node_path |
| Node path. More... | |
| QList< CommitDetailsItem * > | m_items |
| Model items. More... | |
Model that handles modified options details.
It can be used in a view to show modified options, their old and current value. When a method takes as parameter a QModelIndex that can be null, the root is taken is this case.
Definition at line 36 of file CommitDetails.hpp.
| CommitDetails | ( | QObject * | parent = nullptr, |
| const QString & | node_path = QString() |
||
| ) |
Constructor.
| parent | The parent object. May be nullptr. |
| node_path | Path to the node the options belong to. May be empty. |
Definition at line 23 of file CommitDetails.cpp.
| void clear | ( | ) |
Removes all options and clears the node path.
Definition at line 174 of file CommitDetails.cpp.
| int columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Implements QAbstractItemModel::columnCount()
Gives the number of columns for a specified index.
| parent | The index of which we want to know the column count. |
Definition at line 151 of file CommitDetails.cpp.
| QVariant data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const |
Implements QAbstractItemModel::data()
Gives index data, depending on the provided role.
| index | The index from which the data is wanted |
| role | Role of the wanted data. Available roles are defined by Qt::ItemDataRole enum. Qt::DisplayRole is the only role accepted. |
| Returns | the wanted data, of an invalid QVariant (built with default constructor) if the index is not valid, or if the role is not supported. |
Definition at line 31 of file CommitDetails.cpp.
| bool has_options | ( | ) | const |
Checks whether the internal container has options.
true if there is at least one option; otherwise returns false. Definition at line 167 of file CommitDetails.cpp.
| QVariant headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const |
Reimplements QAbstractItemModel::headerData()
Gives header data for a specified column or row.
| section | Column or row number |
| orientation | Indicates wether we want the row header or the column one. |
| role | Role of the wanted data. Available roles are defined by Qt::ItemDataRole enum. Qt::DisplayRole is the only role accepted. |
orientation is Qt::Horizontal section + 1, if orientation is Qt::Vertical QVariant (built with default constructor) if section is less than 0 or bigger than the number of columns or rows. Definition at line 78 of file CommitDetails.cpp.
| QModelIndex index | ( | int | row, |
| int | column, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) | const |
Implements QAbstractItemModel::index()
Builds an index for the wanted object
| row | Row |
| column | Column |
| parent | Parent index, may be null. |
Definition at line 113 of file CommitDetails.cpp.
| QString node_path | ( | ) | const |
Gives the node path.
Definition at line 182 of file CommitDetails.cpp.
| QModelIndex parent | ( | const QModelIndex & | index | ) | const |
Implements QAbstractItemModel::parent()
Gives the parent index of a provided index. index Index from which we want to know the parent index.
Definition at line 134 of file CommitDetails.cpp.
| int rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Implements QAbstractItemModel::rowCount()
Gives the number of children under a parent
| parent | The parent. May be null. |
parent. Definition at line 141 of file CommitDetails.cpp.
| void set_node_path | ( | const QString & | node_path | ) |
| void set_option | ( | const QString & | optionName, |
| const QString & | oldValue, | ||
| const QString & | currentValue | ||
| ) |
Sets a option.
If the option already exists, ites are modified. Otherwise, the option is created.
| optionName | Option name |
| oldValue | Old Value. May be empty. |
| currentValue | Current value. May be empty. |
Definition at line 158 of file CommitDetails.cpp.
|
private |
Model items.
Definition at line 145 of file CommitDetails.hpp.
|
private |
Node path.
Definition at line 142 of file CommitDetails.hpp.
1.8.9.1
|
Send comments to: COOLFluiD Web Admin |