Unique Identification and Grouping

Like I wrote yesterday we had some pretty pressing issue of assigning Id’s to all the entities which we successfully implemented today.

All the entities are now having an Id associated which will be saved in the XML format as well.

We noticed that line, circle and ellipse entities have points drawn with them and these points were being assigned new id which was not the correct behavior we expect. This was resolved by giving the same id as that of parent entity to them.

On the note of unexpected behavior we also found that while making these QGraphicsItems selectable and movable, all entities except point were being correctly working in case of a line item, only the line was being translated and the corresponding end points were not.

Using QGraphicsItemGroup, we managed to correct this as we made groups for each entities as lineGroup, circleGroup and ellipseGroup. These groups are being added to the QList for storage.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s