    QSize size = QStyledItemDelegate::sizeHint(option, index);
    if (index.column() == 0 && !index.parent().isValid()) {
      size.rwidth() = std::min(option.widget->size().width() / 2, size.width() + color_label_width + 8);
    }
    return size;
  }
  
  void SignalItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
    auto item = (SignalModel::Item *)index.internalPointer();
    if (index.column() == 0 && item && item->type == SignalModel::Item::Sig) {
 
</s> remove   QSize size = QStyledItemDelegate::sizeHint(option, index);
  if (index.column() == 0 && !index.parent().isValid()) {
    size.rwidth() = std::min(option.widget->size().width() / 2, size.width() + color_label_width + 8);
 </s> add   int width = option.widget->size().width() / 2;
  if (index.column() == 0) {
    auto text = index.data(Qt::DisplayRole).toString();
    auto it = width_cache.find(text);
    if (it == width_cache.end()) {
      int spacing = option.widget->style()->pixelMetric(QStyle::PM_TreeViewIndentation) + color_label_width + 8;
      it = width_cache.insert(text, option.fontMetrics.width(text) + spacing);
    }
    width = std::min(width, it.value()); </s> remove       emit model->dataChanged(model->index(i, 0), model->index(i, 0));
 </s> add       emit model->dataChanged(model->index(i, 0), model->index(i, 0), {Qt::DecorationRole}); </s> remove #include <QGuiApplication>
 </s> add 
  return {width, QApplication::fontMetrics().height()};
    QSize size = QStyledItemDelegate::sizeHint(option, index);
    if (index.column() == 0 && !index.parent().isValid()) {
      size.rwidth() = std::min(option.widget->size().width() / 2, size.width() + color_label_width + 8);
    }
  return {width, QApplication::fontMetrics().height()};
  }
  
  void SignalItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
    auto item = (SignalModel::Item *)index.internalPointer();
    if (index.column() == 0 && item && item->type == SignalModel::Item::Sig) {
keep keep keep keep replace keep keep keep keep keep
 cabana: improve the performance of updating TreeView in real-time. (#27517) 
tools/cabana/signaledit.cc