def setModelData(self, editor, model, index):
row = index.row()
serial = editor.serialLineEdit.text().trimmed()
barcode = editor.barcodeLineEdit.text().trimmed()
barcode = None if not barcode else barcode
responsable = editor.responsableComboBox.itemData(
editor.responsableComboBox.currentIndex()).toInt()[0]
agregado = editor.fechaAgregadoDateEdit.date()
model.
setData(model.
index(row, pcols
['SERIAL']),
QVariant(serial
)) model.
setData(model.
index(row, pcols
['BARCODE']),
QVariant(barcode
)) model.setData(model.index(row, pcols['RESPONSABLE']),
model.setData(model.index(row, pcols['FECHA_AGREGADO']),
model.submitAll()
def setModelData(self, editor, model, index):
row = index.row()
serial = editor.serialLineEdit.text().trimmed()
barcode = editor.barcodeLineEdit.text().trimmed()
barcode = None if not barcode else barcode
responsable = editor.responsableComboBox.itemData(
editor.responsableComboBox.currentIndex()).toInt()[0]
agregado = editor.fechaAgregadoDateEdit.date()
model.setData(model.index(row, pcols['SERIAL']), QVariant(serial))
model.setData(model.index(row, pcols['BARCODE']), QVariant(barcode))
model.setData(model.index(row, pcols['RESPONSABLE']),
QVariant(responsable))
model.setData(model.index(row, pcols['FECHA_AGREGADO']),
QVariant(agregado))
model.submitAll()
To copy to clipboard, switch view to plain text mode
I have set the edit strategy to manual submit by calling:
Bookmarks