VPTissue Reference Manual
|
A hierarchical tree-like model of checkable items. More...
#include <CheckableTreeModel.h>
Public Member Functions | |
CheckableTreeModel (const boost::property_tree::ptree &tree, QObject *parent=nullptr) | |
Create model. More... | |
virtual int | columnCount (QModelIndex const &) const |
virtual QVariant | data (const QModelIndex &index, int role) const |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
virtual QVariant | headerData (int section, Qt::Orientation o, int role) const |
virtual QModelIndex | index (int row, int column, QModelIndex const &parent) const |
virtual QModelIndex | parent (QModelIndex const &index) const |
virtual int | rowCount (QModelIndex const &parent) const |
virtual bool | setData (QModelIndex const &index, const QVariant &value, int role) |
boost::property_tree::ptree | ToPTree () |
Get checked/unchecked state of items, represented by a ptree of the form discussed in the constructor. More... | |
A hierarchical tree-like model of checkable items.
After construction, the structure remains fixed; The only part of state that can be modified by the user is the checked/unchecked state of items.
Definition at line 33 of file CheckableTreeModel.h.
SimShell::Gui::CheckableTreeModel::CheckableTreeModel | ( | const boost::property_tree::ptree & | tree, |
QObject * | parent = nullptr |
||
) |
Create model.
The items are constructed from a ptree with the following structure:
The <checked> node must be present for every item, the <children> node is optional.
At a later moment, the checked/unchecked state of items can be retrieved by the method ToPTree(). The returned ptree will have the same structure, only the (boolean) values in the <checked> nodes may differ.
tree | A Ptree of form discussed above. |
parent | Qt parent object that will take ownership of this object. |
ptree_bad_path | if malformed ptree. |
ptree_bad_data | if malformed ptree. |
Definition at line 35 of file CheckableTreeModel.cpp.
References parent().
|
virtual |
Definition at line 81 of file CheckableTreeModel.cpp.
|
virtual |
Definition at line 85 of file CheckableTreeModel.cpp.
|
virtual |
Definition at line 104 of file CheckableTreeModel.cpp.
|
virtual |
Definition at line 113 of file CheckableTreeModel.cpp.
|
virtual |
Definition at line 118 of file CheckableTreeModel.cpp.
|
virtual |
Definition at line 134 of file CheckableTreeModel.cpp.
Referenced by CheckableTreeModel().
|
virtual |
Definition at line 151 of file CheckableTreeModel.cpp.
|
virtual |
Definition at line 162 of file CheckableTreeModel.cpp.
ptree SimShell::Gui::CheckableTreeModel::ToPTree | ( | ) |
Get checked/unchecked state of items, represented by a ptree of the form discussed in the constructor.
Definition at line 66 of file CheckableTreeModel.cpp.
Referenced by SimShell::Gui::SaveChangesDialog::Prompt().