MCPcopy Create free account
hub / github.com/MultiMC/Launcher / setModelData

Method setModelData

launcher/ui/instanceview/InstanceDelegate.cpp:402–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402void 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
414QWidget * ListViewDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
415{

Callers

nothing calls this directly

Calls 4

toPlainTextMethod · 0.80
replaceMethod · 0.45
sizeMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected