feat: show network detail view
Includes refactor to not using mainwindow.ui form. More flexible layout management with programmatic initialization.
This commit is contained in:
@@ -125,14 +125,21 @@ QVariant NetworkStreamModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
if (networkIndex == 0xFFFFFFFF)
|
||||
{
|
||||
int actualNetworkIndex = static_cast<int>(id & 0xFFFFFFFF);
|
||||
// This is a network item
|
||||
if (role == Qt::DisplayRole && index.column() == 0)
|
||||
{
|
||||
int actualNetworkIndex = static_cast<int>(id & 0xFFFFFFFF);
|
||||
if (actualNetworkIndex >= 0 && actualNetworkIndex < m_store->networks().size())
|
||||
{
|
||||
return m_store->networks().at(actualNetworkIndex).name.toUpper();
|
||||
}
|
||||
} else if (role == Qt::DisplayRole && index.column() == 1)
|
||||
{
|
||||
if (actualNetworkIndex >= 0 && actualNetworkIndex < m_store->networks().size())
|
||||
{
|
||||
auto net = m_store->networks().at(actualNetworkIndex);
|
||||
return QString("%1/%2").arg(net.openStreamCount).arg(net.openStreamCapacity);
|
||||
}
|
||||
}
|
||||
// Networks don't show unseen count in column 1
|
||||
return QVariant();
|
||||
|
||||
Reference in New Issue
Block a user