    const auto &id = msgs[index.row()];
    auto &can_data = can->lastMessage(id);
  
    if (role == Qt::DisplayRole) {
      switch (index.column()) {
        case 0: return msgName(id);
        case 1: return id.source;
 
</s> remove       case 2: return QString::number(id.address, 16);;
      case 3: return can_data.freq;
 </s> add       case 2: return QString::number(id.address, 16);
      case 3: return getFreq(can_data); </s> remove   uint32_t freq = 0;
 </s> add   double freq = 0;
  auto getFreq = [](const CanData &d) -> QString {
    if (d.freq > 0 && (can->currentSec() - d.ts) < (5.0 / d.freq)) {
      return d.freq >= 1 ? QString::number(std::nearbyint(d.freq)) : QString::number(d.freq, 'f', 2);
    } else {
      return "--";
    }
  };

    const auto &id = msgs[index.row()];
    auto &can_data = can->lastMessage(id);
  
  auto getFreq = [](const CanData &d) -> QString {
    if (d.freq > 0 && (can->currentSec() - d.ts) < (5.0 / d.freq)) {
      return d.freq >= 1 ? QString::number(std::nearbyint(d.freq)) : QString::number(d.freq, 'f', 2);
    } else {
      return "--";
    }
  };

    if (role == Qt::DisplayRole) {
      switch (index.column()) {
        case 0: return msgName(id);
        case 1: return id.source;
keep keep add keep keep keep keep
 cabana: some improvements to messages view (#27935)

* improve messageswidget

* remove double semicolon 
tools/cabana/messageswidget.cc