Saving issue fixed

Deleting any entity from the scene kept it in the list that is being iterated when streaming the data to xml file while saving the contents of a scene. Though the entity was not present on the scene, we could find it saved. Exceptions.. 😛

The saving is and must be done corresponding to the entities present at the given time of saving the file. The items() function was the solution. It has been used previously but after moving to QGraphicsItemGroup, it was lost. This function returns the list of items present in a scene. We considered it to be applicable only for QGraphicsItem despite the fact that it is a function of QGraphicsScene which had nothing to do with the type of entities present in the scene. A sigh!

items().contains() made it fixed.

Leave a Reply