SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
timeserieslistmodel.h
Go to the documentation of this file.
1
29#ifndef OPENSWMMVIS_UI_PANELS_TIMESERIESLISTMODEL_H
30#define OPENSWMMVIS_UI_PANELS_TIMESERIESLISTMODEL_H
31
32#include <QAbstractListModel>
33#include <QPointer>
34#include <QVector>
35
37class TimeseriesProvider;
38class TimeseriesRegistry;
39}
40
41namespace openswmmvis::ui {
42
43class TimeseriesListModel : public QAbstractListModel
44{
45 Q_OBJECT
46public:
47 explicit TimeseriesListModel(QObject *parent = nullptr);
49
55
57 openswmmvis::timeseries::TimeseriesProvider *providerAt(int row) const;
58
60 int rowOf(const openswmmvis::timeseries::TimeseriesProvider *p) const;
61
62 // QAbstractListModel ----------------------------------------------------
63
64 int rowCount(const QModelIndex &parent = {}) const override;
65 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
66 bool setData(const QModelIndex &index, const QVariant &value,
67 int role = Qt::EditRole) override;
68 Qt::ItemFlags flags(const QModelIndex &index) const override;
69
70private slots:
71 void onProviderAdded_(openswmmvis::timeseries::TimeseriesProvider *p);
72 void onProviderAboutToBeRemoved_(openswmmvis::timeseries::TimeseriesProvider *p);
73 void onProviderRenamed_(openswmmvis::timeseries::TimeseriesProvider *p,
74 const QString &prev, const QString &now);
75
76private:
77 QPointer<openswmmvis::timeseries::TimeseriesRegistry> m_registry;
81 QVector<openswmmvis::timeseries::TimeseriesProvider *> m_rows;
82
83 void rebuildCache_();
84};
85
86} // namespace openswmmvis::ui
87
88#endif // OPENSWMMVIS_UI_PANELS_TIMESERIESLISTMODEL_H
Definition timeseriesprovider.h:43
Definition timeseriesregistry.h:35
Definition timeserieslistmodel.h:44
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Definition timeserieslistmodel.cpp:87
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition timeserieslistmodel.cpp:101
openswmmvis::timeseries::TimeseriesProvider * providerAt(int row) const
The provider at a given row, or nullptr.
Definition timeserieslistmodel.cpp:50
int rowCount(const QModelIndex &parent={}) const override
Definition timeserieslistmodel.cpp:73
openswmmvis::timeseries::TimeseriesRegistry * registry() const noexcept
Definition timeserieslistmodel.cpp:45
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Definition timeserieslistmodel.cpp:79
void setRegistry(openswmmvis::timeseries::TimeseriesRegistry *registry)
Bind to a registry. Pass nullptr to clear. Subscribes to the registry's lifecycle + rename signals so...
Definition timeserieslistmodel.cpp:24
int rowOf(const openswmmvis::timeseries::TimeseriesProvider *p) const
Row index for a provider, or -1.
Definition timeserieslistmodel.cpp:56
SWMM_FilePathRole role
Definition ioportabilitynormalizer.cpp:22
ArrowPlacement p
Definition linesymbollayer.cpp:27
int index
Position in m_quadRegions / m_quadReports.
Definition meshgenerator.cpp:153
Definition timeseriesprovider.h:34
Definition openswmmvislayer.h:43
Definition aquiferprovider.h:21
QVector< int > parent
union-find
Definition pslgminsize.cpp:176