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 {
20class treenode;
21
22namespace models {
23
24class tree
25 : public QAbstractItemModel
26 , public TreeModelInterface
27 , public model_common_impl<tree>
29{
30 Q_OBJECT
31
33
34public:
36
37 ~tree();
38
39 explicit tree(const QStringList& Headers, QObject* parent = nullptr);
40
41 type_index index(int row, int column, const type_index& parent) const override;
42
43 type_index parent(const type_index& child) const override;
44
45 type_index mapToSource(type_index const& i) { return i; }
46
47 int rowCount(const type_index& parent) const override;
48
49 int columnCount(const type_index& parent) const override;
50
51 Qt::ItemFlags flags(const type_index& index) const override;
52
53 QVariant data(const type_index& index, int role = Qt::DisplayRole) const override;
54
55 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
56
57 bool insertRows(int position, int rows, const type_index& parent) override;
58
59 void fetchMore(const type_index& parent) override;
60
61 bool canFetchMore(const type_index& parent) const override;
62
63 bool hasChildren(const type_index& parent) const override;
64
65 bool setData(const type_index& index, const QVariant& value, int role) override;
66
67 QStringList mimeTypes() const override;
68
69 QMimeData* mimeData(const QModelIndexList& indexes) const override;
70
71 type_datum* getnode(const type_index& index) const override;
72
73 type_index getindex(treenode* NodeItem, type_index const& RootIndex = QModelIndex()) const;
74
75 void ResetModel();
76
77 void objectsUpdated(const std::vector<dbe::dref>& objects);
78
79signals:
80 void ObjectFile(QString);
81
82private:
84
85private slots:
87
88 void slot_create_object(QString const& src, dref const& obj);
89 void slot_remove_object(QString const& src, dref const& obj);
90 void slot_update_object(QString const& src, dref const& obj);
91 void slot_rename_object(QString const& src, dref const& obj);
92};
93
94}
95// namespace models
96} // namespace dbe
97#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:370
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:106
void ResetModel()
Definition tree.cpp:299
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Definition tree.cpp:162
dbe::treenode type_datum
Definition tree.hpp:35
void slot_rename_object(QString const &src, dref const &obj)
type_index getindex(treenode *NodeItem, type_index const &RootIndex=QModelIndex()) const
Definition tree.cpp:278
bool setData(const type_index &index, const QVariant &value, int role) override
Definition tree.cpp:232
type_datum * getnode(const type_index &index) const override
Definition tree.cpp:306
type_index index(int row, int column, const type_index &parent) const override
Definition tree.cpp:35
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:172
bool abstract_classes_selectable
Definition tree.hpp:83
void ToggleAbstractClassesSelectable(bool)
Definition tree.cpp:363
QStringList mimeTypes() const override
Definition tree.cpp:242
bool hasChildren(const type_index &parent) const override
Definition tree.cpp:221
void slot_update_object(QString const &src, dref const &obj)
int columnCount(const type_index &parent) const override
Definition tree.cpp:76
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:45
void ObjectFile(QString)
tree(const QStringList &Headers, QObject *parent=nullptr)
Definition tree.cpp:19
Qt::ItemFlags flags(const type_index &index) const override
Definition tree.cpp:88
void slot_remove_object(QString const &src, dref const &obj)
int rowCount(const type_index &parent) const override
Definition tree.cpp:62
#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:17