This project is a fork of qsqlcodegen, which can be found here: http://sourceforge.net/projects/qsqlcodegen/
You will need Qt 4.x or 5.x in order to build QSQLGenerator. There is a pro file and a visual studio 2008 solution provided.
When you create database tables, the first field must be the key field. The code assumes that ordinal 0 is the key field. As you can see in my test database, I just use _id.
One more note. If you are going to be inserting a large number of records, open a transaction and use commit when done. This will make an operation that takes 25 minutes without a transaction, take 5 seconds.
The code is released under the MIT license.