You can't make an incorrect code work. Finding the real problem with a bad design will take more time than rewriting it using correct solutions. Either implement the model by subclassing from QAbstractListModel or switch to QStandardItemModel completely.
Bookmarks