Files
llink/cpp/src/networkstreammodel.h
2026-02-19 19:41:26 -08:00

31 lines
975 B
C++

#ifndef NETWORKSTREAMMODEL_H
#define NETWORKSTREAMMODEL_H
#include <QAbstractItemModel>
#include "store.h"
class NetworkStreamModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit NetworkStreamModel(Store *store, QObject *parent = nullptr);
// Required QAbstractItemModel interface
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &child) const override;
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;
// Helper methods for MainWindow
QString streamIdFromIndex(const QModelIndex &index) const;
bool isStreamItem(const QModelIndex &index) const;
QString networkIdFromIndex(const QModelIndex &index) const;
private:
Store *m_store;
};
#endif // NETWORKSTREAMMODEL_H