From 5120f6c525b8eef415d0e5c3c3849efde9f85838 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Tue, 10 Jan 2017 18:13:14 +0530 Subject: [PATCH] sign: Highlight non-zero aggr pkt loss in red --- client/streamstatsmodel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/streamstatsmodel.cpp b/client/streamstatsmodel.cpp index 7ff13a2..8123cb2 100644 --- a/client/streamstatsmodel.cpp +++ b/client/streamstatsmodel.cpp @@ -107,10 +107,16 @@ QVariant StreamStatsModel::data(const QModelIndex &index, int role) const return QBrush(QColor("#eeeeee")); } + Guid guid = guidList_.at(index.row()); + if (role == Qt::ForegroundRole) { + if ((index.column() == kAggrPktLoss) + && aggrStreamStats_.value(guid).pktLoss) + return QBrush(QColor("red")); + } + if (role != Qt::DisplayRole) return QVariant(); - Guid guid = guidList_.at(index.row()); if (index.column() < kMaxAggrStreamStats) { int stat = index.column() % kMaxAggrStreamStats; switch (stat) {