1 #ifndef GUI_QTMODEL_CHECKABLETREEMODEL_H_INCLUDED
2 #define GUI_QTMODEL_CHECKABLETREEMODEL_H_INCLUDED
22 #include <boost/property_tree/ptree.hpp>
23 #include <QAbstractItemModel>
73 virtual QVariant
data(
const QModelIndex&
index,
int role)
const;
76 virtual Qt::ItemFlags
flags(
const QModelIndex& index)
const;
79 virtual QVariant
headerData(
int section, Qt::Orientation o,
int role)
const;
82 virtual QModelIndex
index(
int row,
int column, QModelIndex
const&
parent)
const;
85 virtual QModelIndex
parent(QModelIndex
const& index)
const;
88 virtual int rowCount(QModelIndex
const& parent)
const;
91 virtual bool setData(QModelIndex
const& index,
const QVariant& value,
int role);
97 boost::property_tree::ptree
ToPTree();
107 std::vector<Item*> children;
118 #endif // end_of_inclde_guard
virtual QVariant headerData(int section, Qt::Orientation o, int role) const
see the online Qt documentation
virtual int columnCount(QModelIndex const &) const
virtual QVariant data(const QModelIndex &index, int role) const
virtual bool setData(QModelIndex const &index, const QVariant &value, int role)
virtual int rowCount(QModelIndex const &parent) const
virtual QModelIndex parent(QModelIndex const &index) const
virtual QModelIndex index(int row, int column, QModelIndex const &parent) const
CheckableTreeModel(const boost::property_tree::ptree &tree, QObject *parent=nullptr)
Create model.
boost::property_tree::ptree ToPTree()
Get checked/unchecked state of items, represented by a ptree of the form discussed in the constructor...
virtual Qt::ItemFlags flags(const QModelIndex &index) const
see the online Qt documentation
Namespace for generic graphical shell for simulators.
A hierarchical tree-like model of checkable items.