Hi

I've been looking into the different kind of pointers available inside Qt in some detail over the last few weeks.

It looks like QSharedPointer will fit my needs the best. To give a rough overview what I need:

I have an observer class which observes subjects attached to it. I want to be able to see who takes part in the relationship from both sides.

That is, from the observer's side I need to know which subjects are attached to it (I created a pointerlist for this which removes subjects as soon as they are destroyed), as well as who is pointing to the observer (For this I want to use QSharedPointer).

From a subject's side I need to know which observers are observing it (I will also use the pointerlist for this), as well as who has references to it (Again, QSharedPointer is my plan).

From what I found in the Qt docs, it seems like QSharedPointer is the best way to go. The only problem is that it does not seems to give any information about who is sharing the pointer, or what the reference count is.

Is there an easier way to do this, or is the alternative to rewrite my own QSharedPointer / subclassing QSharedPointer to create my own.

Thanks for your insights,
Regards,
Jaco