My confusion codes from something like this.

Qt Code:
  1. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
  2. QSqlDatabase db2 = QSqlDatabase::addDatabase("QSQLITE");
  3.  
  4. db.setDatabaseName("downloads.sqlite");
  5. if (!db.open()) {
  6. qDebug() << "Error opening DB.";
  7. }
  8.  
  9. db2.setDatabaseName("history.sqlite");
  10. if (!db2.open()) {
  11. qDebug() << "Error opening DB.";
  12. }
  13.  
  14. qtm->setTable("moz_downloads");
  15. qtm->select();
To copy to clipboard, switch view to plain text mode 

In this case which db is the QSqlTableModel qtm model going to associate the "moz_downloads" table with?

If the table-model was destroyed then it could not print out the records in my button routine could it? But it does.