It turns out the code above was missing a second setTable() to re-fetch the sql table field information.

Qt Code:
  1. model->setTable("test");
  2. model->select();
  3.  
  4.  
  5. return app.exec();
To copy to clipboard, switch view to plain text mode