feat: create stream and add members to stream

This commit is contained in:
talksik
2026-02-06 14:28:54 -08:00
parent dd655c9679
commit e204c638c7
11 changed files with 385 additions and 168 deletions
+20
View File
@@ -12,6 +12,26 @@ NetworkStreamModel::NetworkStreamModel(Store *store, QObject *parent) : QAbstrac
beginResetModel();
endResetModel();
});
// Granular update: repaint a single stream row when its properties change (e.g. unseen count)
connect(m_store, &Store::streamUpdated, this, [this](const QString &streamId) {
const auto &networks = m_store->networks();
for (int ni = 0; ni < networks.size(); ++ni)
{
const auto &streams = networks.at(ni).streams;
for (int si = 0; si < static_cast<int>(streams.size()); ++si)
{
if (streams[si].id == streamId)
{
// Build indices for both columns of this stream row
QModelIndex topLeft = index(si, 0, index(ni, 0));
QModelIndex bottomRight = index(si, 1, index(ni, 0));
emit dataChanged(topLeft, bottomRight, {Qt::DisplayRole, Qt::ForegroundRole});
return;
}
}
}
});
}
QModelIndex NetworkStreamModel::index(int row, int column, const QModelIndex &parent) const