code: def setModelData(self, editor, model, index):
          
          if index.isValid():
              value = editor.text()
              model.setData(index, value, QtCore.Qt.EditRole)
docs: Gets data from the editor widget and stores it in the specified model at the item index.
  
          Args:
              editor (QtGui.QLineEdit): editor widget.
              model (QAbstractItemModel): parent model.
              index (QModelIndex): model data index.