| 400 | } |
| 401 | |
| 402 | void ListViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const |
| 403 | { |
| 404 | QTextEdit * realeditor = qobject_cast<NoReturnTextEdit *>(editor); |
| 405 | QString text = realeditor->toPlainText(); |
| 406 | text.replace(QChar('\n'), QChar(' ')); |
| 407 | text = text.trimmed(); |
| 408 | if(text.size() != 0) |
| 409 | { |
| 410 | model->setData(index, text); |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | QWidget * ListViewDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const |
| 415 | { |
nothing calls this directly
no test coverage detected