DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SchemaCustomTableModel.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/SchemaCustomTableModel.h to include/dbe/SchemaCustomTableModel.hpp).
5
6#ifndef CUSTOMTABLEMODEL_H
7#define CUSTOMTABLEMODEL_H
8
10#include <QAbstractTableModel>
11#include <QBrush>
12#include <QColor>
13#include <QStringList>
14#include <QMimeData>
15
16#include <vector>
17
18namespace dbse
19{
20
21class CustomTableModel: public QAbstractTableModel
22{
23 Q_OBJECT
24public:
25 explicit CustomTableModel ( QStringList Headers, QObject * parent = nullptr );
27 int rowCount ( const QModelIndex & parent ) const;
28 int columnCount ( const QModelIndex & parent ) const;
29 Qt::ItemFlags flags ( const QModelIndex & index ) const;
30 QVariant headerData ( int section, Qt::Orientation orientation, int role ) const;
31 QVariant data ( const QModelIndex & index, int role ) const;
32 QStringList getRowFromIndex ( QModelIndex & index );
33 void setupModel();
35 QStringList mimeTypes() const;
36 QMimeData * mimeData ( const QModelIndexList & indexes ) const;
37private:
38 QStringList HeaderList;
39 QList<QList<QString>> m_data;
40 QList<QList<QString>> m_tooltips;
41 std::vector<QBrush> m_brushes;
42 std::vector<QColor> m_backgrounds;
43};
44
45} // namespace dbse
46#endif // CUSTOMTABLEMODEL_H
int rowCount(const QModelIndex &parent) const
QMimeData * mimeData(const QModelIndexList &indexes) const
QVariant data(const QModelIndex &index, int role) const
QVariant headerData(int section, Qt::Orientation orientation, int role) const
CustomTableModel(QStringList Headers, QObject *parent=nullptr)
QList< QList< QString > > m_tooltips
int columnCount(const QModelIndex &parent) const
QStringList mimeTypes() const
Drag/Drop Handlers.
QList< QList< QString > > m_data
std::vector< QColor > m_backgrounds
Qt::ItemFlags flags(const QModelIndex &index) const
std::vector< QBrush > m_brushes
QStringList getRowFromIndex(QModelIndex &index)
Including QT Headers.