mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-25 07:52:03 +08:00
cabana: draw message bytes at the same width (#27150)
This commit is contained in:
@@ -65,11 +65,6 @@ MessageBytesDelegate::MessageBytesDelegate(QObject *parent) : QStyledItemDelegat
|
||||
}
|
||||
|
||||
void MessageBytesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||
QList<QVariant> 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<QVariant> colors = index.data(Qt::UserRole).toList();
|
||||
int i = 0;
|
||||
for (auto &byte : opt.text.split(" ")) {
|
||||
if (i < colors.size()) {
|
||||
|
||||
Reference in New Issue
Block a user