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
10#include "dbe/TableNode.hpp"
12
14
15#include <QAbstractTableModel>
16
17#include <memory>
18
19namespace dbe
20{
21namespace models
22{
23class table:
24 public QAbstractTableModel,
25 public model_common_impl<table>,
27{
28 Q_OBJECT
29
31
32public :
33
35
36 explicit table ( QObject * parent = nullptr );
37 ~table();
38
39 int rowCount ( type_index const & parent ) const override;
40 int columnCount ( type_index const & parent ) const override;
41
42 QVariant data ( type_index const & index, int role ) const override;
43
44 bool setData ( type_index const & index, const QVariant & value, int role ) override;
45
46 QVariant headerData ( int section, Qt::Orientation orientation, int role ) const override;
47
48 Qt::ItemFlags flags ( type_index const & index ) const override;
49
50 TableNode * getnode ( const QModelIndex & Index ) const;
51
52 QStringList mimeTypes() const override;
53
54 Qt::DropActions supportedDropActions() const override;
55
56 bool dropMimeData ( const QMimeData * data, Qt::DropAction action, int row, 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
94 void setheader ( dunedaq::conffwk::class_t const & );
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:34
table(QObject *parent=nullptr)
Including QT Headers.
Definition table.cpp:23
QList< type_datum * > createrow(treenode const *)
Definition table.cpp:319
dunedaq::conffwk::class_t class_type_info
Definition table.hpp:77
TableNode * getnode(const QModelIndex &Index) const
Definition table.cpp:481
void reset(QString const &)
Definition table.cpp:392
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, type_index const &parent) override
Definition table.cpp:217
QList< dbe::dref > * GetTableObjects()
Definition table.cpp:476
Qt::DropActions supportedDropActions() const override
Definition table.cpp:205
int rowCount(type_index const &parent) const override
Definition table.cpp:33
QStringList mimeTypes() const override
Definition table.cpp:210
void setheader(dunedaq::conffwk::class_t const &)
Definition table.cpp:406
QVariant data(type_index const &index, int role) const override
Definition table.cpp:52
bool BuildTableFromObject(QList< QStringList > BuildList)
Definition table.cpp:431
bool is_built() const
Definition table.cpp:461
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition table.cpp:166
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:189
bool setData(type_index const &index, const QVariant &value, int role) override
Definition table.cpp:125
QString get_class_name() const
Definition table.cpp:466
QStringList this_headers
Definition table.hpp:79
void slot_update_object(QString const &src, dref const &obj)
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:497
tref GetTableObject(int ObjectIndex) const
Definition table.cpp:456
int columnCount(type_index const &parent) const override
Definition table.cpp:43
bool BuildTableFromClass(const QString &ClassName, bool BuildSubClasses=false)
Definition table.cpp:268
QList< dref > this_objects
Definition table.hpp:80
void objectsUpdated(const std::vector< dbe::dref > &objects)
Definition table.cpp:523
QList< QList< TableNode * > > this_structure
Definition table.hpp:81
#define MODEL_COMMON_IMPL_REQ_DEF(classname)
Include QT Headers.
inner::configobject::tref tref
Definition tref.hpp:35
config_object_description dref