-
Notifications
You must be signed in to change notification settings - Fork 0
/
gstreamerlogmodel.h
68 lines (59 loc) · 1.71 KB
/
gstreamerlogmodel.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef GSTREAMERLOGMODEL_H
#define GSTREAMERLOGMODEL_H
#include <QtCore/QAbstractTableModel>
#include "timestamp.h"
class GStreamerLogLine
{
Q_GADGET
Q_PROPERTY(Timestamp Timestamp MEMBER timestamp)
Q_PROPERTY(int Process MEMBER pid)
Q_PROPERTY(QString Thread MEMBER tid)
Q_PROPERTY(QString Level MEMBER level)
Q_PROPERTY(QString Category MEMBER category)
Q_PROPERTY(QString Source MEMBER source)
Q_PROPERTY(int Line MEMBER line)
Q_PROPERTY(QString Function MEMBER function)
Q_PROPERTY(QString Object MEMBER object)
Q_PROPERTY(QString Message MEMBER message)
public:
int id;
Timestamp timestamp;
int pid;
QString tid;
QString level;
QString category;
QString source;
int line;
QString function;
QString object;
QString message;
};
class GStreamerLogModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum Column {
TimestampColumn,
PidColumn,
TidColumn,
LevelColumn,
CategoryColumn,
SourceColumn,
LineColumn,
FunctionColumn,
ObjectColumn,
MessageColumn,
};
explicit GStreamerLogModel(const QString &fileName, QObject *parent = nullptr);
~GStreamerLogModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
public slots:
void reload();
private:
class Private;
QScopedPointer<Private> d;
};
#endif // GSTREAMERLOGMODEL_H