forked from collin80/SavvyCAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
canconnectionmodel.h
34 lines (23 loc) · 925 Bytes
/
canconnectionmodel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef CANCONNECTIONMODEL_H
#define CANCONNECTIONMODEL_H
#include <QAbstractTableModel>
#include "canbus.h"
class CANConnection;
class CANConnectionModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit CANConnectionModel(QObject *parent = 0);
virtual ~CANConnectionModel();
// from abstractmodel:
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
void add(CANConnection* pConn_p);
void remove(CANConnection* pConn_p);
void replace(int idx , CANConnection* pConn_p);
CANConnection* getAtIdx(int) const;
void refresh(int pIndex=-1);
};
#endif // CANCONNECTIONMODEL_H