PDA

View Full Version : should i use shared data?



jajdoo
7th August 2011, 09:45
i need to represent a scene (containing rendergroups, meshes, lights etc).
i need data from the scene to be available to a few separate holders, all of which may alter the content.
currently, i use QObject sub classes because i want them to be able to communicate using signals (specifically, to inform each other when changes occur), and the convenience of a singular object when removing.
lately i've been thinking that might just be an overkill because:
- bizarre things may happen (such as a light object containing a scene as a child)
- not very elegant with ctrl+z (recreating a QObject or holding a reference to it after its "dead")
- i tend to spam QObject sub classes
so, should i switch to QSharedDara with explicit sharing? if so, how should i inform holders of changes?