DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
table.hpp
Go to the documentation of this file.
1#ifndef TABLEMODEL_H
2#define TABLEMODEL_H
3
5#include "dbe/TableNode.hpp"
7
9
10#include <QAbstractTableModel>
11
12#include <memory>
13
14namespace dbe
15{
16namespace models
17{
18class table:
19 public QAbstractTableModel,
20 public model_common_impl<table>,
22{
23 Q_OBJECT
24
26
27public :
28
30
31 explicit table ( QObject * parent = nullptr );
32 ~table();
33
34 int rowCount ( type_index const & parent ) const override;
35 int columnCount ( type_index const & parent ) const override;
36
37 QVariant data ( type_index const & index, int role ) const override;
38
39 bool setData ( type_index const & index, const QVariant & value, int role ) override;
40
41 QVariant headerData ( int section, Qt::Orientation orientation, int role ) const override;
42
43 Qt::ItemFlags flags ( type_index const & index ) const override;
44
45 TableNode * getnode ( const QModelIndex & Index ) const;
46
47 QStringList mimeTypes() const override;
48
49 Qt::DropActions supportedDropActions() const override;
50
51 bool dropMimeData ( const QMimeData * data, Qt::DropAction action, int row, int column,
52 type_index const & parent ) override;
53
54 void ResetModel();
55
56 bool BuildTableFromClass ( const QString & ClassName, bool BuildSubClasses = false );
57
58 bool BuildTableFromObject ( QList<QStringList> BuildList );
59
60 bool is_built() const;
61 QString get_class_name() const;
62
63 tref GetTableObject ( int ObjectIndex ) const;
64
65 QList<dbe::dref> * GetTableObjects();
66
67 void objectsUpdated(const std::vector<dbe::dref>& objects);
68
69private:
70 bool enabled;
73
74 QStringList this_headers;
75 QList<dref> this_objects;
76 QList<QList<TableNode * >> this_structure;
77
82 void reset ( QString const & );
83
89 void setheader ( dunedaq::conffwk::class_t const & );
90
91 QList<type_datum *> createrow ( treenode const * );
92
93public slots:
94 void slot_data_dropped ( QMimeData const &, Qt::DropAction );
95
96private slots:
97 void slot_create_object ( QString const & src, dref const & obj );
98 void slot_remove_object ( QString const & src, dref const & obj );
99 void slot_update_object ( QString const & src, dref const & obj );
100 void slot_rename_object ( QString const & src, dref const & obj );
101
102signals:
103 void ResetTab();
104};
105
106}
107// namespace models
108}// namespace dbe
109#endif // TABLEMODEL_H
table(QObject *parent=nullptr)
Including QT Headers.
Definition table.cpp:18
TableNode type_datum
Definition table.hpp:29
QList< type_datum * > createrow(treenode const *)
Definition table.cpp:294
dunedaq::conffwk::class_t class_type_info
Definition table.hpp:72
TableNode * getnode(const QModelIndex &Index) const
Definition table.cpp:455
void reset(QString const &)
Definition table.cpp:366
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, type_index const &parent) override
Definition table.cpp:192
QList< dbe::dref > * GetTableObjects()
Definition table.cpp:450
Qt::DropActions supportedDropActions() const override
Definition table.cpp:180
int rowCount(type_index const &parent) const override
Definition table.cpp:28
QStringList mimeTypes() const override
Definition table.cpp:185
void setheader(dunedaq::conffwk::class_t const &)
Definition table.cpp:380
QVariant data(type_index const &index, int role) const override
Definition table.cpp:47
bool BuildTableFromObject(QList< QStringList > BuildList)
Definition table.cpp:405
bool is_built() const
Definition table.cpp:435
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Definition table.cpp:142
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:164
bool setData(type_index const &index, const QVariant &value, int role) override
Definition table.cpp:101
QString get_class_name() const
Definition table.cpp:440
QStringList this_headers
Definition table.hpp:74
void slot_update_object(QString const &src, dref const &obj)
QString this_class_name
Definition table.hpp:71
void slot_create_object(QString const &src, dref const &obj)
void slot_data_dropped(QMimeData const &, Qt::DropAction)
Definition table.cpp:471
tref GetTableObject(int ObjectIndex) const
Definition table.cpp:430
int columnCount(type_index const &parent) const override
Definition table.cpp:38
bool BuildTableFromClass(const QString &ClassName, bool BuildSubClasses=false)
Definition table.cpp:243
QList< dref > this_objects
Definition table.hpp:75
void objectsUpdated(const std::vector< dbe::dref > &objects)
Definition table.cpp:497
QList< QList< TableNode * > > this_structure
Definition table.hpp:76
#define MODEL_COMMON_IMPL_REQ_DEF(classname)
Include QT Headers.