DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
tree.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4// Renamed since fork: yes (from dbe/tree.h to include/dbe/tree.hpp).
5
6#ifndef TREEMODEL_H
7#define TREEMODEL_H
8
10#include <QAbstractItemModel>
16
17extern char const * const dbe_lib_structure_version;
18
19namespace dbe
20{
21class treenode;
22
23namespace models
24{
25
26class tree:
27 public QAbstractItemModel,
28 public TreeModelInterface,
29 public model_common_impl<tree>,
31{
32 Q_OBJECT
33
35
36public :
38
39 ~tree();
40
41 explicit tree ( const QStringList & Headers, QObject * parent = nullptr );
42
43
44 type_index index ( int row, int column, const type_index & parent ) const override;
45
46 type_index parent ( const type_index & child ) const override;
47
48 type_index mapToSource ( type_index const & i )
49 {
50 return i;
51 }
52
53 int rowCount ( const type_index & parent ) const override;
54
55 int columnCount ( const type_index & parent ) const override;
56
57 Qt::ItemFlags flags ( const type_index & index ) const override;
58
59 QVariant data ( const type_index & index, int role = Qt::DisplayRole ) const override;
60
61 QVariant headerData ( int section, Qt::Orientation orientation,
62 int role = Qt::DisplayRole ) const override;
63
64 bool insertRows ( int position, int rows, const type_index & parent ) override;
65
66 void fetchMore ( const type_index & parent ) override;
67
68 bool canFetchMore ( const type_index & parent ) const override;
69
70 bool hasChildren ( const type_index & parent ) const override;
71
72 bool setData ( const type_index & index, const QVariant & value, int role ) override;
73
74 QStringList mimeTypes() const override;
75
76 QMimeData * mimeData ( const QModelIndexList & indexes ) const override;
77
78 type_datum * getnode ( const type_index & index ) const override;
79
80 type_index getindex ( treenode * NodeItem,
81 type_index const & RootIndex = QModelIndex() ) const;
82
83 void ResetModel();
84
85 void objectsUpdated(const std::vector<dbe::dref>& objects);
86
87signals:
88 void ObjectFile ( QString );
89
90private:
92
93private slots:
95
96 void slot_create_object ( QString const & src, dref const & obj );
97 void slot_remove_object ( QString const & src, dref const & obj );
98 void slot_update_object ( QString const & src, dref const & obj );
99 void slot_rename_object ( QString const & src, dref const & obj );
100};
101
102}
103// namespace models
104}// namespace dbe
105#endif // TREEMODEL_H
MODEL_COMMON_TYPES_TOPLEVEL_DEFINITIONS model_common_async_operations()
void slot_create_object(QString const &src, dref const &obj)
void objectsUpdated(const std::vector< dbe::dref > &objects)
Definition tree.cpp:391
void fetchMore(const type_index &parent) override
Definition tree.cpp:220
QVariant data(const type_index &index, int role=Qt::DisplayRole) const override
Definition tree.cpp:121
void ResetModel()
Definition tree.cpp:315
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition tree.cpp:168
dbe::treenode type_datum
Definition tree.hpp:37
void slot_rename_object(QString const &src, dref const &obj)
type_index getindex(treenode *NodeItem, type_index const &RootIndex=QModelIndex()) const
Definition tree.cpp:291
bool setData(const type_index &index, const QVariant &value, int role) override
Definition tree.cpp:245
type_datum * getnode(const type_index &index) const override
Definition tree.cpp:321
type_index index(int row, int column, const type_index &parent) const override
Definition tree.cpp:37
bool canFetchMore(const type_index &parent) const override
Definition tree.cpp:209
bool insertRows(int position, int rows, const type_index &parent) override
Definition tree.cpp:179
bool abstract_classes_selectable
Definition tree.hpp:91
void ToggleAbstractClassesSelectable(bool)
Definition tree.cpp:385
QStringList mimeTypes() const override
Definition tree.cpp:255
bool hasChildren(const type_index &parent) const override
Definition tree.cpp:234
void slot_update_object(QString const &src, dref const &obj)
int columnCount(const type_index &parent) const override
Definition tree.cpp:84
type_index parent(const type_index &child) const override
Definition tree.cpp:53
QMimeData * mimeData(const QModelIndexList &indexes) const override
Definition tree.cpp:262
type_index mapToSource(type_index const &i)
Definition tree.hpp:48
void ObjectFile(QString)
tree(const QStringList &Headers, QObject *parent=nullptr)
Definition tree.cpp:18
Qt::ItemFlags flags(const type_index &index) const override
Definition tree.cpp:98
void slot_remove_object(QString const &src, dref const &obj)
int rowCount(const type_index &parent) const override
Definition tree.cpp:68
#define MODEL_COMMON_IMPL_REQ_DEF(classname)
Include QT Headers.
config_object_description dref
char const *const dbe_lib_structure_version
Including QT Headers.
Definition tree.cpp:16