opps, I never called QSqlTableModel::setTable(). Added an Q_ASSERT to the macro that gets the column id's so should have that problem again. Don't know why so many folks hate macro's, they sure speed up development when used correctly:)
Ok, next issue. How do I get the primary key from this inserted row?
In the beforeInsert() slot, the PK column is being set to not be generates so the SQLite's AUTOINCREMENT can do it thing:
record.setGenerated(_orderModel->orderIdNo(), false);
Here is the little catch, I know for an absolute FACT, in the very near feature the DB will be converted over to Firebird, which does NOT have a AUTOINCREMENT concept like most DB's.
So ideally if there is a way to get the PK that will work today for SQLite and tomorrow for Firebird, that would be ideal!
Sam