Quote Originally Posted by spirit View Post
create QSqlTableModel model; on a heap.


Did you read the two posts above? I think no you didn't.
For this example it makes no difference if the model is on heap or stack.