-
Notifications
You must be signed in to change notification settings - Fork 0
/
gelfmessagemodel.h
32 lines (24 loc) · 865 Bytes
/
gelfmessagemodel.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
#ifndef GELFMESSAGEMODEL_H
#define GELFMESSAGEMODEL_H
#include <QAbstractTableModel>
#include <QJsonObject>
#include <QStringList>
#include <QList>
class GELFMessageModel : public QAbstractTableModel
{
Q_OBJECT
public:
GELFMessageModel(QObject *parent = 0);
QJsonObject rowData(int row) const;
private:
QStringList column_names;
QList<QJsonObject> messages;
protected:
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
public slots:
void onMessage(QJsonObject message);
};
#endif // GELFMESSAGEMODEL_H