Alright, for understanding the principle I stripped my model class to this:

Qt Code:
  1. class model(QSqlTableModel):
  2.  
  3. def __init__(self, db_file, mode):
  4. super().__init__()
  5. self.db = QSqlDatabase.addDatabase('QSQLITE')
  6. print(db_file)
  7. self.db.setDatabaseName("start.db")
  8. self.setEditStrategy(QSqlRelationalTableModel.OnFieldChange)
  9. self.setTable("VOCABULARY")
  10. self.select()
  11.  
  12. print(self.rowCount())
To copy to clipboard, switch view to plain text mode 

I also removed all the constraints from the database.
But The Row Count is showing 0, and the treeview is still empty. There should be exactly 1 row in the table.