forked from triochi/qusbmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataManager.h
51 lines (44 loc) · 1017 Bytes
/
DataManager.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* DataManager.h
*
* Created on: Feb 28, 2009
* Author: archivator
*/
#ifndef DATAMANAGER_H_
#define DATAMANAGER_H_
#include <QSqlDatabase>
#include <QSqlDriver>
#include <QSqlError>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QSqlResult>
#include <QDateTime>
#include <QDebug>
#include <QByteArray>
#include <QObject>
#include <QStandardItemModel>
#include <QStringList>
#include "types.h"
#include "SqliteBridge.h"
class DataManager: public QObject{
Q_OBJECT
protected:
static DataManager* instance;
DataManager();
void setupDatabase();
QSqlDatabase database;
QStringList triggeredColumns;
SQLiteBridge bridge;
public:
~DataManager();
void addPacket(const mon_bin_get* packet);
static DataManager& get();
QStandardItemModel packets;
public slots:
void onRowInserted(QList<QVariant> data);
protected slots:
void onProcessPacket(const mon_bin_get* packet);
signals:
void processPacket(const mon_bin_get* packet);
};
#endif /* DATAMANAGER_H_ */