Made a start with the notification system. However need to figure out

how i want to handle multithreading and screen updates.
This commit is contained in:
eelke 2019-08-14 06:53:28 +02:00
parent 5494e5076b
commit 7f09d5fe07
7 changed files with 216 additions and 0 deletions

31
pglab/NotificationModel.h Normal file
View file

@ -0,0 +1,31 @@
#ifndef NOTIFICATIONMODEL_H
#define NOTIFICATIONMODEL_H
#include <QAbstractTableModel>
#include <memory>
class NotificationService;
class NotificationModel: public QAbstractTableModel {
public:
enum class Col {
Severity,
ShortMessage,
DetailMessage,
Count // SHOULD BE LAST
};
NotificationModel();
virtual int rowCount(const QModelIndex &parent = {}) const override;
virtual int columnCount(const QModelIndex &parent = {}) const override;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
private:
std::shared_ptr<NotificationService> m_notifications;
};
#endif // NOTIFICATIONMODEL_H