diff --git a/tools/cabana/util.cc b/tools/cabana/util.cc index 726cbbe2a1..023e893e11 100644 --- a/tools/cabana/util.cc +++ b/tools/cabana/util.cc @@ -65,11 +65,6 @@ MessageBytesDelegate::MessageBytesDelegate(QObject *parent) : QStyledItemDelegat } void MessageBytesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - QList colors = index.data(Qt::UserRole).toList(); - if (colors.empty()) { - QStyledItemDelegate::paint(painter, option, index); - return; - } QStyleOptionViewItemV4 opt = option; initStyleOption(&opt, index); @@ -87,6 +82,7 @@ void MessageBytesDelegate::paint(QPainter *painter, const QStyleOptionViewItem & int m = space.width() / 2; const QMargins margins(m, m, m, m); + QList colors = index.data(Qt::UserRole).toList(); int i = 0; for (auto &byte : opt.text.split(" ")) { if (i < colors.size()) {