#pragma once #include #include struct HistoryItem { int id = -1; double timestamp = 0; std::string method; std::string scheme; std::string host; unsigned short port = 0; std::string path; int status_code = 0; std::string reason; double rtt = 0.0; size_t size = 0; }; class HistoryModel : public QAbstractTableModel { Q_OBJECT private: std::vector* current_items = nullptr; public: HistoryModel(QObject *parent = nullptr); 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 update(std::vector* items); };