pgLab/pglab/NotificationModel.h
eelke 7f09d5fe07 Made a start with the notification system. However need to figure out
how i want to handle multithreading and screen updates.
2019-08-14 06:54:50 +02:00

31 lines
769 B
C++

#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