On Monday 05 December 2011 14:50:23 Jeff Mitchell wrote:

> QSharedPointer:
> * Use for all three (disk cache, cookie jar, qnam) so that the user can
> keep a ref around if they want (also for the static methods)

> * Make QSharedPointer be able to delete properly with a forward declaration

Not possible.  (or already possible with a custom deleter)


> * QObject::connect needs to be able to take a QSharedPointer<QObject>
> * QObject::connect needs to be able to take a QWeakPointer<QObject>

I don't understand this point: you can just pass the pointer.data() to 
QObject::connect, and QObject::connect automatically take care of 
disconnecting when the object is destroyed.

Or do you mean that one want QObject::connect to hold a reference?
I don't think it is a good idea. Just put the receiver in a 
QList<QSharedPointer> kept by the sender (or vice-versa)
Else, it is opening the pandora box of the circular references.


_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to