MCPcopy Create free account
hub / github.com/QtExcel/QXlsx / setModelData

Method setModelData

ExcelTableEditor/excelitemdelegate.cpp:86–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void ExcelItemDelegate::setModelData(QWidget *editor,
87 QAbstractItemModel *model,
88 const QModelIndex &index) const
89{
90 if (auto *spin = qobject_cast<QDoubleSpinBox *>(editor)) {
91 model->setData(index, spin->value(), Qt::EditRole);
92 return;
93 }
94
95 if (auto *date_edit = qobject_cast<QDateEdit *>(editor)) {
96 model->setData(index, date_edit->date(), Qt::EditRole);
97 return;
98 }
99
100 if (auto *dt_edit = qobject_cast<QDateTimeEdit *>(editor)) {
101 model->setData(index, dt_edit->dateTime(), Qt::EditRole);
102 return;
103 }
104
105 if (auto *line_edit = qobject_cast<QLineEdit *>(editor)) {
106 model->setData(index, line_edit->text(), Qt::EditRole);
107 return;
108 }
109
110 QStyledItemDelegate::setModelData(editor, model, index);
111}

Callers

nothing calls this directly

Calls 2

valueMethod · 0.80
dateTimeMethod · 0.80

Tested by

no test coverage detected