How does QSqlRelationalTableModel know which DB to use?
Solved
General and Desktop
-
I am writing a database application using SQLite. I can manually run queries and populate fields but want to use a QSqlRelationalTableModel. I see in the example a very simple process for using it. It isn't working quite right for me, though.
I have a DB connection in a global connection that I was using in the old style that worked quite well. I am not sure how to tell the QSqlRelationalTableModel to use that DB connection. Where do I tie the open database to the model?
-
@cmulcahy said:
hi
it takes a db in constructor
http://doc.qt.io/qt-5/qsqlrelationaltablemodel.html#QSqlRelationalTableModel