/usr/include/qt4/QtCore/qabstractitemmodel.h:360:5: error: ‘QAbstractTableModel::QAbstractTableModel(const QAbstractTableModel&)’ is private
That error message means that you are trying to copy a QObject which does not quite have the "value" semantics, but more like "identity". QObjects are inherently not copyable. The reason is that what would you do with the parent/child hierarchy in such cases?
This gives you some hint that you are trying to misuse your QObject subclass instance, i.e. declaring it as a stack object rather than heap.
This is the problematic place in your code:
QSqlQueryModel model = new QSqlQueryModel();
This seem to be missing the start as follows:
QSqlQueryModel *model = new QSqlQueryModel();
^
It seems that you are trying to allocate the object on the heap as opposed to the stack, and that is good, so it is just a typo, probably.
One additional note is that please make sure that it will not leak memory, i.e. either set a parent (directly or indirectly) for it, or use smart pointers. I would suggest the former. That will guarantee that your pointer is automatically deleted when the parent gets deleted.