DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbse::CustomModelInterface Class Referenceabstract

#include <SchemaCustomModelInterface.hpp>

Inheritance diagram for dbse::CustomModelInterface:
[legend]
Collaboration diagram for dbse::CustomModelInterface:
[legend]

Public Member Functions

 CustomModelInterface (QStringList Headers, QObject *parent=nullptr)
 Including Schema Editor.
 
 ~CustomModelInterface ()
 
int rowCount (const QModelIndex &parent) const
 
int columnCount (const QModelIndex &parent) const
 
Qt::ItemFlags flags (const QModelIndex &index) const
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const
 
QVariant data (const QModelIndex &index, int role) const
 
QStringList getRowFromIndex (QModelIndex &index)
 
virtual void setupModel ()=0
 

Protected Attributes

QStringList HeaderList
 
QList< QStringList > Data
 

Detailed Description

Definition at line 11 of file SchemaCustomModelInterface.hpp.

Constructor & Destructor Documentation

◆ CustomModelInterface()

dbse::CustomModelInterface::CustomModelInterface ( QStringList Headers,
QObject * parent = nullptr )
explicit

Including Schema Editor.

Definition at line 5 of file SchemaCustomModelInterface.cpp.

6 : QAbstractTableModel ( parent ),
7 HeaderList ( Headers )
8{
9}

◆ ~CustomModelInterface()

dbse::CustomModelInterface::~CustomModelInterface ( )

Definition at line 11 of file SchemaCustomModelInterface.cpp.

12{
13}

Member Function Documentation

◆ columnCount()

int dbse::CustomModelInterface::columnCount ( const QModelIndex & parent) const

Definition at line 21 of file SchemaCustomModelInterface.cpp.

22{
23 Q_UNUSED ( parent )
24 return HeaderList.size();
25}

◆ data()

QVariant dbse::CustomModelInterface::data ( const QModelIndex & index,
int role ) const

Definition at line 49 of file SchemaCustomModelInterface.cpp.

50{
51 if ( role != Qt::DisplayRole )
52 {
53 return QVariant();
54 }
55
56 return Data.value ( index.row() ).value ( index.column() );
57}

◆ flags()

Qt::ItemFlags dbse::CustomModelInterface::flags ( const QModelIndex & index) const

Definition at line 27 of file SchemaCustomModelInterface.cpp.

28{
29 Q_UNUSED ( index )
30 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
31}

◆ getRowFromIndex()

QStringList dbse::CustomModelInterface::getRowFromIndex ( QModelIndex & index)

Definition at line 59 of file SchemaCustomModelInterface.cpp.

60{
61 if ( !index.isValid() )
62 {
63 return QStringList();
64 }
65
66 return Data.at ( index.row() );
67}

◆ headerData()

QVariant dbse::CustomModelInterface::headerData ( int section,
Qt::Orientation orientation,
int role ) const

Definition at line 33 of file SchemaCustomModelInterface.cpp.

35{
36 if ( role != Qt::DisplayRole )
37 {
38 return QVariant();
39 }
40
41 if ( orientation == Qt::Horizontal )
42 {
43 return HeaderList.at ( section );
44 }
45
46 return QVariant();
47}

◆ rowCount()

int dbse::CustomModelInterface::rowCount ( const QModelIndex & parent) const

Definition at line 15 of file SchemaCustomModelInterface.cpp.

16{
17 Q_UNUSED ( parent )
18 return Data.size();
19}

◆ setupModel()

Member Data Documentation

◆ Data

QList<QStringList> dbse::CustomModelInterface::Data
protected

Definition at line 26 of file SchemaCustomModelInterface.hpp.

◆ HeaderList

QStringList dbse::CustomModelInterface::HeaderList
protected

Definition at line 25 of file SchemaCustomModelInterface.hpp.


The documentation for this class was generated from the following files: