Hello,
I'm fairly new to Qt and C++, and I'm having trouble understanding how exactly to populate a subclass of QAbstractTableModel with data from a QSqlQuery. Say for example I have a sql query that returns the itemID, description, and price for some number of items (data is from two joined tables, so QSqlTableModel will not work). Assume that I want to put the returned data in a QList<QSqlRecord> (as suggested in this post: http://www.qtcentre.org/threads/2114...from-QSqlQuery ) and also assume I have a subclass of QAbstractTableModel called MyTableModel. Could someone please give me a brief example of what the MyTableModel::data function might look like and how it would be implemented? Should I pass the QList to the constructor for MyTableModel, the data function itself, or none of the above? Any tips would be much appreciated.