qt - Deleting QStandardItems from QStandardItemModel -
i trying delete qstandarditems qstandrditemmodel using qpersistentindex. items deleted, when iterate through model deleted rows appear without data.
i using following code delete items:
qlist<qpersistentmodelindex> selectedindexes; foreach (const qmodelindex &modelindex, this->selectionmodel()->selectedindexes()) { selectedindexes << modelindex; } foreach (const qpersistentmodelindex &index, selectedindexes) { qpersistentmodelindex parentindex = index.parent(); model->removerow(index.row(),parentindex); } // in function foreach (const qmodelindex &index, this->selectionmodel()->selectedindexes()) { // soemthing , items appear without data shown // in image below }
Comments
Post a Comment