Initial alert model

This commit is contained in:
Dan Paulat 2022-10-13 06:59:27 -05:00
parent 5cf9746e97
commit 9afba385ea
3 changed files with 286 additions and 2 deletions

View file

@ -0,0 +1,45 @@
#pragma once
#include <scwx/qt/types/text_event_key.hpp>
#include <memory>
#include <QAbstractTableModel>
namespace scwx
{
namespace qt
{
namespace model
{
class AlertModelImpl;
class AlertModel : public QAbstractTableModel
{
public:
explicit AlertModel(QObject* parent = nullptr);
~AlertModel();
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;
public slots:
void HandleAlert(const types::TextEventKey& alertKey);
void HandleMapUpdate(double latitude, double longitude);
private:
std::unique_ptr<AlertModelImpl> p;
friend class AlertModelImpl;
};
} // namespace model
} // namespace qt
} // namespace scwx