DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
tree.hpp
Go to the documentation of this file.
1#ifndef TREEMODEL_H
2#define TREEMODEL_H
3
5#include <QAbstractItemModel>
11
12extern char const * const dbe_lib_structure_version;
13
14namespace dbe
15{
16class treenode;
17
18namespace models
19{
20
21class tree:
22 public QAbstractItemModel,
23 public TreeModelInterface,
24 public model_common_impl<tree>,
26{
27 Q_OBJECT
28
30
31public :
33
34 ~tree();
35
36 explicit tree ( const QStringList & Headers, QObject * parent = nullptr );
37
38
39 type_index index ( int row, int column, const type_index & parent ) const override;
40
41 type_index parent ( const type_index & child ) const override;
42
43 type_index mapToSource ( type_index const & i )
44 {
45 return i;
46 }
47
48 int rowCount ( const type_index & parent ) const override;
49
50 int columnCount ( const type_index & parent ) const override;
51
52 Qt::ItemFlags flags ( const type_index & index ) const override;
53
54 QVariant data ( const type_index & index, int role = Qt::DisplayRole ) const override;
55
56 QVariant headerData ( int section, Qt::Orientation orientation,
57 int role = Qt::DisplayRole ) const override;
58
59 bool insertRows ( int position, int rows, const type_index & parent ) override;
60
61 void fetchMore ( const type_index & parent ) override;
62
63 bool canFetchMore ( const type_index & parent ) const override;
64
65 bool hasChildren ( const type_index & parent ) const override;
66
67 bool setData ( const type_index & index, const QVariant & value, int role ) override;
68
69 QStringList mimeTypes() const override;
70
71 QMimeData * mimeData ( const QModelIndexList & indexes ) const override;
72
73 type_datum * getnode ( const type_index & index ) const override;
74
75 type_index getindex ( treenode * NodeItem,
76 type_index const & RootIndex = QModelIndex() ) const;
77
78 void ResetModel();
79
80 void objectsUpdated(const std::vector<dbe::dref>& objects);
81
82signals:
83 void ObjectFile ( QString );
84
85private:
87
88private slots:
90
91 void slot_create_object ( QString const & src, dref const & obj );
92 void slot_remove_object ( QString const & src, dref const & obj );
93 void slot_update_object ( QString const & src, dref const & obj );
94 void slot_rename_object ( QString const & src, dref const & obj );
95};
96
97}
98// namespace models
99}// namespace dbe
100#endif // TREEMODEL_H
void slot_create_object(QString const &src, dref const &obj)
void objectsUpdated(const std::vector< dbe::dref > &objects)
Definition tree.cpp:379
void fetchMore(const type_index &parent) override
Definition tree.cpp:208
QVariant data(const type_index &index, int role=Qt::DisplayRole) const override
Definition tree.cpp:116
void ResetModel()
Definition tree.cpp:303
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition tree.cpp:156
void slot_rename_object(QString const &src, dref const &obj)
type_index getindex(treenode *NodeItem, type_index const &RootIndex=QModelIndex()) const
Definition tree.cpp:279
dbe::treenode type_datum
Definition tree.hpp:32
bool setData(const type_index &index, const QVariant &value, int role) override
Definition tree.cpp:233
type_datum * getnode(const type_index &index) const override
Definition tree.cpp:309
type_index index(int row, int column, const type_index &parent) const override
Definition tree.cpp:32
bool canFetchMore(const type_index &parent) const override
Definition tree.cpp:197
bool insertRows(int position, int rows, const type_index &parent) override
Definition tree.cpp:167
bool abstract_classes_selectable
Definition tree.hpp:86
void ToggleAbstractClassesSelectable(bool)
Definition tree.cpp:373
QStringList mimeTypes() const override
Definition tree.cpp:243
bool hasChildren(const type_index &parent) const override
Definition tree.cpp:222
void slot_update_object(QString const &src, dref const &obj)
int columnCount(const type_index &parent) const override
Definition tree.cpp:79
type_index parent(const type_index &child) const override
Definition tree.cpp:48
QMimeData * mimeData(const QModelIndexList &indexes) const override
Definition tree.cpp:250
type_index mapToSource(type_index const &i)
Definition tree.hpp:43
void ObjectFile(QString)
tree(const QStringList &Headers, QObject *parent=nullptr)
Definition tree.cpp:13
Qt::ItemFlags flags(const type_index &index) const override
Definition tree.cpp:93
void slot_remove_object(QString const &src, dref const &obj)
int rowCount(const type_index &parent) const override
Definition tree.cpp:63
#define MODEL_COMMON_IMPL_REQ_DEF(classname)
Include QT Headers.
char const *const dbe_lib_structure_version
Including QT Headers.
Definition tree.cpp:11