python - problem with QSqlTalbeModel . table is not showing -


I have a QsqlTableModel that is assigned in the table view. My problem is that this table does not populate the table inside the scene. It is still empty and it says (unable to find table shots) - when final printing is being done .. ERRT () - retrieve the function.Support prompt (check code below) to check that Is there a table called shots and yes, it prints everything, just fine, and the connection is also okay .. but the table view is still empty, am I wrong?
Please help
Thanks Advance

Category SqlModel (QtSql.QSqlTableModel):

  def __init __ (self): Super (SqlModel, Self) .__ init __ () self.connect () self.retrieveResult () self.setEditStrategy (QtSql.QSqlTableModel.OnManualSubmit) self.setTable ("" "shots" ") self.select () def connect (self) : Db.setUserName ("admin") db.setPassword ("moayyad" ): Query = QtSql.QSqlQuery () query.exec _ ("select from" "shots" "") while query.next (): table = query.value (1) .toString () print table  

I found it ^ _ ^ . (Connect) function should be called in the main loop


Comments