I finally solved the problem, I had m_pModel on two different places (in CDatabaseFoundation and in CBrowserWindow). I've deleted the one in CBrowserWindow and works fine. For future references, what do you think, where should be m_pModel (QSqlRelationTableModel) declared in class that handles database connection or in class that handles record browsing?
Bookmarks