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 <QMimeData>
14#include <QStringList>
15
16#include <vector>
17
18namespace dbse {
19
20class CustomTableModel : public QAbstractTableModel
21{
22 Q_OBJECT
23public:
24 explicit CustomTableModel(QStringList Headers, QObject* parent = nullptr);
26 int rowCount(const QModelIndex& parent) const;
27 int columnCount(const QModelIndex& parent) const;
28 Qt::ItemFlags flags(const QModelIndex& index) const;
29 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
30 QVariant data(const QModelIndex& index, int role) const;
31 QStringList getRowFromIndex(QModelIndex& index);
32 void setupModel();
34 QStringList mimeTypes() const;
35 QMimeData* mimeData(const QModelIndexList& indexes) const;
36
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.