#include <SchemaCustomTableModel.hpp>
Definition at line 16 of file SchemaCustomTableModel.hpp.
◆ CustomTableModel()
| dbse::CustomTableModel::CustomTableModel |
( |
QStringList | Headers, |
|
|
QObject * | parent = nullptr ) |
|
explicit |
◆ ~CustomTableModel()
| dbse::CustomTableModel::~CustomTableModel |
( |
| ) |
|
◆ columnCount()
| int dbse::CustomTableModel::columnCount |
( |
const QModelIndex & | parent | ) |
const |
◆ data()
| QVariant dbse::CustomTableModel::data |
( |
const QModelIndex & | index, |
|
|
int | role ) const |
Definition at line 54 of file SchemaCustomTableModel.cpp.
55{
56 if ( role == Qt::DisplayRole )
57 {
59 }
60 if ( role == Qt::ToolTipRole )
61 {
63 }
64 if (role == Qt::ForegroundRole) {
66 }
67 if (role == Qt::BackgroundRole) {
69 }
70
71 return QVariant();
72}
QList< QList< QString > > m_tooltips
QList< QList< QString > > m_data
std::vector< QColor > m_backgrounds
std::vector< QBrush > m_brushes
◆ flags()
| Qt::ItemFlags dbse::CustomTableModel::flags |
( |
const QModelIndex & | index | ) |
const |
Definition at line 32 of file SchemaCustomTableModel.cpp.
33{
34 Q_UNUSED ( index );
35 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
36}
◆ getRowFromIndex()
| QStringList dbse::CustomTableModel::getRowFromIndex |
( |
QModelIndex & | index | ) |
|
◆ headerData()
| QVariant dbse::CustomTableModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role ) const |
Definition at line 38 of file SchemaCustomTableModel.cpp.
40{
41 if ( role != Qt::DisplayRole )
42 {
43 return QVariant();
44 }
45
46 if ( orientation == Qt::Horizontal )
47 {
49 }
50
51 return QVariant();
52}
◆ mimeData()
| QMimeData * dbse::CustomTableModel::mimeData |
( |
const QModelIndexList & | indexes | ) |
const |
Definition at line 120 of file SchemaCustomTableModel.cpp.
121{
122 QMimeData *
mimeData =
new QMimeData();
123 QByteArray encodedData;
124
125 QDataStream stream ( &encodedData, QIODevice::WriteOnly );
126
127 foreach ( QModelIndex index, indexes )
128 {
130 {
131 QString ClassName =
data ( index, Qt::DisplayRole ).toString();
132 stream << ClassName;
133 }
134 }
135
136 mimeData->setData (
"application/vnd.text.list", encodedData );
138}
QMimeData * mimeData(const QModelIndexList &indexes) const
QVariant data(const QModelIndex &index, int role) const
◆ mimeTypes()
| QStringList dbse::CustomTableModel::mimeTypes |
( |
| ) |
const |
Drag/Drop Handlers.
Definition at line 113 of file SchemaCustomTableModel.cpp.
114{
115 QStringList types;
116 types << "application/vnd.text.list";
117 return types;
118}
◆ rowCount()
| int dbse::CustomTableModel::rowCount |
( |
const QModelIndex & | parent | ) |
const |
◆ setupModel()
| void dbse::CustomTableModel::setupModel |
( |
| ) |
|
Definition at line 84 of file SchemaCustomTableModel.cpp.
85{
86 std::vector<OksClass *> ClassList;
88
89 for ( unsigned int i = 0; i < ClassList.size(); ++i )
90 {
91 QList<QString> Row;
92 OksClass * Class = ClassList.at ( i );
93 Row.append ( QString ( Class->
get_name().c_str() ) );
96
101 }
105 }
106 else {
109 }
110 }
111}
static KernelWrapper & GetInstance()
void GetClassList(std::vector< dunedaq::oks::OksClass * > &ClassList) const
const std::string & get_name() const noexcept
const std::string & get_description() const noexcept
OksFile * get_file() const noexcept
const std::string & get_full_file_name() const
static QColor get_color(const QString &item, const QString &group)
◆ HeaderList
| QStringList dbse::CustomTableModel::HeaderList |
|
private |
◆ m_backgrounds
| std::vector<QColor> dbse::CustomTableModel::m_backgrounds |
|
private |
◆ m_brushes
| std::vector<QBrush> dbse::CustomTableModel::m_brushes |
|
private |
◆ m_data
| QList<QList<QString> > dbse::CustomTableModel::m_data |
|
private |
◆ m_tooltips
| QList<QList<QString> > dbse::CustomTableModel::m_tooltips |
|
private |
The documentation for this class was generated from the following files: