From 078f06dbaff2d1af57f1294095cfbd9c6e357ce1 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 31 Jan 2023 02:56:03 +0800 Subject: [PATCH] cabana: draw message bytes at the same width (#27150) --- tools/cabana/util.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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()) {