DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
treeselection.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/treeselection.h to include/dbe/treeselection.hpp).
5
6#ifndef TREESELECTIONMODEL_H
7#define TREESELECTIONMODEL_H
8
10#include "dbe/dbcontroller.hpp"
12#include "dbe/treenode.hpp"
13
15
16#include <QSortFilterProxyModel>
17#include <QUuid>
18
19namespace dbe {
20namespace models {
21
23 : public QSortFilterProxyModel
24 , public TreeModelInterface
25 , public model_common_impl<treeselection>
26 , public model_common_async_operations<treeselection>
27{
28 Q_OBJECT
29
31
32public:
34
40
42
43 explicit treeselection(QObject* parent = 0);
44
45 type_datum* getnode(type_index const& index) const override;
46
47 void fetchMore(type_index const& index);
48
49 bool hasChildren(type_index const& index) const;
50
51 bool canFetchMore(type_index const& index) const;
52
53 void SetFilterType(FilterType Filter);
54 void SetFilterRestrictionLevel(int Levels);
55 void SetQueryObjects(std::vector<tref> Objects);
56
57 std::vector<dbe::tref> GetQueryObjects();
58
59 void ResetQueryObjects();
60 void ResetModel();
61
62protected:
63 bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
64
65 bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
66
67private slots:
68 void ToggleEmptyClasses(bool HideLocal);
69
70private:
71 bool AcceptItem(const QModelIndex& SourceIndex, int LevelRestriction) const;
72
73 bool RegexpFilter(int sourceRow, const QModelIndex& sourceParent) const;
74
75 bool ObjectFilter(int sourceRow, const QModelIndex& sourceParent) const;
76
77 int AtDepth(const QModelIndex& SourceParent) const;
78
81
82 bool Hide;
83
84 std::vector<tref> QueryObjects;
85
86private slots:
87 void slot_create_object(QString const& src, dref const& obj);
88 void slot_remove_object(QString const& src, dref const& obj);
89 void slot_update_object(QString const& src, dref const& obj);
90 void slot_rename_object(QString const& src, dref const& obj);
91};
92
93}
94// namespace models
95} // namespace dbe
96#endif // TREESELECTIONMODEL_H
MODEL_COMMON_TYPES_TOPLEVEL_DEFINITIONS model_common_async_operations()
void slot_update_object(QString const &src, dref const &obj)
void slot_remove_object(QString const &src, dref const &obj)
int AtDepth(const QModelIndex &SourceParent) const
void SetFilterType(FilterType Filter)
bool canFetchMore(type_index const &index) const
treeselection(QObject *parent=0)
Including DBE.
std::vector< tref > QueryObjects
bool hasChildren(type_index const &index) const
bool RegexpFilter(int sourceRow, const QModelIndex &sourceParent) const
std::vector< dbe::tref > GetQueryObjects()
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
type_datum * getnode(type_index const &index) const override
bool ObjectFilter(int sourceRow, const QModelIndex &sourceParent) const
void ToggleEmptyClasses(bool HideLocal)
void SetQueryObjects(std::vector< tref > Objects)
bool lessThan(const QModelIndex &left, const QModelIndex &right) const
void slot_create_object(QString const &src, dref const &obj)
void SetFilterRestrictionLevel(int Levels)
bool AcceptItem(const QModelIndex &SourceIndex, int LevelRestriction) const
void fetchMore(type_index const &index)
void slot_rename_object(QString const &src, dref const &obj)
#define MODEL_COMMON_IMPL_REQ_DEF(classname)
Include QT Headers.
config_object_description dref