DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
table.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/table.h to include/dbe/table.hpp).
5
6#ifndef TABLEMODEL_H
7#define TABLEMODEL_H
8
9#include "dbe/TableNode.hpp"
10#include "dbe/dbcontroller.hpp"
12
14
15#include <QAbstractTableModel>
16
17#include <memory>
18
19namespace dbe {
20namespace models {
21class table
22 : public QAbstractTableModel
23 , public model_common_impl<table>
24 , public model_common_async_operations<table>
25{
26 Q_OBJECT
27
29
30public:
32
33 explicit table(QObject* parent = nullptr);
34 ~table();
35
36 int rowCount(type_index const& parent) const override;
37 int columnCount(type_index const& parent) const override;
38
39 QVariant data(type_index const& index, int role) const override;
40
41 bool setData(type_index const& index, const QVariant& value, int role) override;
42
43 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
44
45 Qt::ItemFlags flags(type_index const& index) const override;
46
47 TableNode* getnode(const QModelIndex& Index) const;
48
49 QStringList mimeTypes() const override;
50
51 Qt::DropActions supportedDropActions() const override;
52
53 bool dropMimeData(const QMimeData* data,
54 Qt::DropAction action,
55 int row,
56 int column,
57 type_index const& parent) override;
58
59 void ResetModel();
60
61 bool BuildTableFromClass(const QString& ClassName, bool BuildSubClasses = false);
62
63 bool BuildTableFromObject(QList<QStringList> BuildList);
64
65 bool is_built() const;
66 QString get_class_name() const;
67
68 tref GetTableObject(int ObjectIndex) const;
69
70 QList<dbe::dref>* GetTableObjects();
71
72 void objectsUpdated(const std::vector<dbe::dref>& objects);
73
74private:
75 bool enabled;
78
79 QStringList this_headers;
80 QList<dref> this_objects;
81 QList<QList<TableNode*>> this_structure;
82
87 void reset(QString const&);
88
95
96 QList<type_datum*> createrow(treenode const*);
97
98public slots:
99 void slot_data_dropped(QMimeData const&, Qt::DropAction);
100
101private slots:
102 void slot_create_object(QString const& src, dref const& obj);
103 void slot_remove_object(QString const& src, dref const& obj);
104 void slot_update_object(QString const& src, dref const& obj);
105 void slot_rename_object(QString const& src, dref const& obj);
106
107signals:
108 void ResetTab();
109};
110
111}
112// namespace models
113} // namespace dbe
114#endif // TABLEMODEL_H
MODEL_COMMON_TYPES_TOPLEVEL_DEFINITIONS model_common_async_operations()
TableNode type_datum
Definition table.hpp:31
table(QObject *parent=nullptr)
Including QT Headers.
Definition table.cpp:23
QList< type_datum * > createrow(treenode const *)
Definition table.cpp:293
dunedaq::conffwk::class_t class_type_info
Definition table.hpp:77
TableNode * getnode(const QModelIndex &Index) const
Definition table.cpp:442
void reset(QString const &)
Definition table.cpp:354
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, type_index const &parent) override
Definition table.cpp:204
QList< dbe::dref > * GetTableObjects()
Definition table.cpp:436
Qt::DropActions supportedDropActions() const override
Definition table.cpp:190
int rowCount(type_index const &parent) const override
Definition table.cpp:33
QStringList mimeTypes() const override
Definition table.cpp:196
void setheader(dunedaq::conffwk::class_t const &)
Definition table.cpp:368
QVariant data(type_index const &index, int role) const override
Definition table.cpp:53
bool BuildTableFromObject(QList< QStringList > BuildList)
Definition table.cpp:388
bool is_built() const
Definition table.cpp:418
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition table.cpp:156
void slot_remove_object(QString const &src, dref const &obj)
void slot_rename_object(QString const &src, dref const &obj)
Qt::ItemFlags flags(type_index const &index) const override
Definition table.cpp:175
bool setData(type_index const &index, const QVariant &value, int role) override
Definition table.cpp:122
QString get_class_name() const
Definition table.cpp:424
QStringList this_headers
Definition table.hpp:79
void slot_update_object(QString const &src, dref const &obj)
QList< QList< TableNode * > > this_structure
Definition table.hpp:81
QString this_class_name
Definition table.hpp:76
void slot_create_object(QString const &src, dref const &obj)
void slot_data_dropped(QMimeData const &, Qt::DropAction)
Definition table.cpp:459
tref GetTableObject(int ObjectIndex) const
Definition table.cpp:412
int columnCount(type_index const &parent) const override
Definition table.cpp:43
bool BuildTableFromClass(const QString &ClassName, bool BuildSubClasses=false)
Definition table.cpp:252
QList< dref > this_objects
Definition table.hpp:80
void objectsUpdated(const std::vector< dbe::dref > &objects)
Definition table.cpp:486
#define MODEL_COMMON_IMPL_REQ_DEF(classname)
Include QT Headers.
inner::configobject::tref tref
Definition tref.hpp:36
config_object_description dref