Log Viewer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.0 KiB

#ifndef BASEJSONMODEL_H
#define BASEJSONMODEL_H
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QFile>
#include <QVector>
#include <QAbstractTableModel>
#include "LogWarehouse.h"
class LogTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum ELogColumn : int
{
id,
level,
timestamp,
file,
func,
lineno,
msg,
scope,
threadId,
};
LogTableModel(LogWarehouse_ptr warehouse);
~LogTableModel() override;
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;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
private:
QMap<int, QString> _columnMap;
LogWarehouse_ptr _warehouse;
void initColumnMap();
};
#endif //BASEJSONMODEL_H