title: How to submit data to the QSqlTableModel that has been changed by the user on the QTableView
body: <p>I'm trying to retrieve the input from the user when modifying the QTableView as seen in the photo and then updating the QSqlTableModel in order to get my database modified.</p>
  <p><a href="https://i.stack.imgur.com/ExG1Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ExG1Z.png" alt="photo" /></a></p>
  <p>The problem is that QTableView has no signals as QTableWidget for example, &quot;itemChanged&quot;, or &quot;currentItemChanged&quot;, so it's difficult for me to capture the value that the user introduces, cause I can't get that signal, it doesn't exist in QTableView? How do I recognize that moment?</p>
  <p>I must say I've managed to use the signal &quot;selectionChanged&quot; making QSqlTableModel a selectionModel, as I've understood. But that signal only gets me a QModelIndex where the focus is, and gets me the actual value of the cell, not the introduced by the user after clicking and editing the cell...</p>
  <p>This is my code:</p>
  <pre><code>self.model = QSqlTableModel(db=db)
  self.model.setEditStrategy(QSqlTableModel.OnFieldChange)
  self.ui.projectSelector_tableView.setModel(self.model)
  header = self.ui.projectSelector_tableView.horizontalHeader()
  header.setSectionResizeMode(QtWidgets.QHeaderView.ResizeToContents)
  self.model.setTable(&quot;tablefromdb&quot;)
  self.model.select()
  
  self.ui.projectSelector_tableView.selectionModel().selectionChanged.connect(self.selChanged)
  self.projectSelectorWindow.show()
  
  
  def selChanged(self, a, b):
      self.currentindex = a.indexes()[0]
      self.previousindex = b.indexes()[0]
  
  def submitChanges(self):
      self.model.setData(self.currentindex, self.value)
      self.model.submitAll()
  </code></pre>
  <p>At the end of the day, I want to get the &quot;self.value&quot; that the user has typed in, and setData it to the QSqlTableModel, and I actually have the QModelIndex where it goes, but not the value.</p>
  <p>I hope anyone can help me, thanks you all!</p>