you creates QStandardItemModel model(5, 2); in a stack (an object will be destroyed when out of scope). you should create in the heap, i.e. QStandardItemModel *model = new QStandardItemModel(5, 2);.
you creates QStandardItemModel model(5, 2); in a stack (an object will be destroyed when out of scope). you should create in the heap, i.e. QStandardItemModel *model = new QStandardItemModel(5, 2);.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Bookmarks