User can edit the label of terminal inside the terminal strip editor

This commit is contained in:
joshua
2021-09-10 21:01:03 +02:00
parent 4dd2dc259f
commit b08c2bd90b
5 changed files with 34 additions and 3 deletions

View File

@@ -154,6 +154,13 @@ bool TerminalStripModel::setData(const QModelIndex &index, const QVariant &value
modified_ = true;
modified_cell = FUNCTION_CELL;
}
else if (column_ == LABEL_CELL &&
role == Qt::EditRole)
{
rtd.label_ = value.toString();
modified_ = true;
modified_cell = LABEL_CELL;
}
//Set the modification to the terminal data
if (modified_)
@@ -384,5 +391,8 @@ void TerminalStripModelDelegate::setModelData(QWidget *editor, QAbstractItemMode
model->setData(index, qcb->currentData(), Qt::EditRole);
}
}
else {
QStyledItemDelegate::setModelData(editor, model, index);
}
}
}