| 420 | } |
| 421 | |
| 422 | void ListViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const |
| 423 | { |
| 424 | QTextEdit * realeditor = qobject_cast<NoReturnTextEdit *>(editor); |
| 425 | QString text = realeditor->toPlainText(); |
| 426 | text.replace(QChar('\n'), QChar(' ')); |
| 427 | text = text.trimmed(); |
| 428 | // Prevent instance names longer than 128 chars |
| 429 | text.truncate(128); |
| 430 | if(text.size() != 0) |
| 431 | { |
| 432 | model->setData(index, text); |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | QWidget * ListViewDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const |
| 437 | { |
nothing calls this directly
no test coverage detected