-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbeanpacketsloggermodel.h
More file actions
34 lines (23 loc) · 936 Bytes
/
beanpacketsloggermodel.h
File metadata and controls
34 lines (23 loc) · 936 Bytes
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 BEANPACKETSLOGGERMODEL_H
#define BEANPACKETSLOGGERMODEL_H
#include "beanpacket.h"
#include <QAbstractTableModel>
class BeanPacketsLoggerModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit BeanPacketsLoggerModel(QObject *parent = nullptr);
~BeanPacketsLoggerModel() override;
// Header:
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
// Basic functionality:
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void clearPackets();
void saveAsCSV(const QString& fileName);
void appendPacket(QSharedPointer<BeanPacket> packet);
private:
QList<QSharedPointer<BeanPacket>> *packets;
};
#endif // BEANPACKETSLOGGERMODEL_H