[Interest] QWeakPointer in Qt5
thiago.macieira at intel.com
Wed Jun 20 08:27:57 CEST 2012
On quarta-feira, 20 de junho de 2012 06.42.52, Philippe wrote:
> In Qt 5 in git, I have seen changes to this implementation. Mainly, in
> Qt 4.8, it was stated that "QWeakPointer serves as a replacement to
> QPointer". This is no longer the case and this is mentionned as
> deprecated (qsharedpointer.cpp).
> QWeakPointer was quoted in 4.8 as "more efficient than QPointer, so it
> should be preferred in all new code.".
> I use it a lot without trouble. So I would like to know why this (apparent)
> Question for Thiago I guess...
Yes, I need to blog about this (I have a draft actually).
In Qt5, QPointer and QWeakPointer are equally efficient. However, we've split
- QPointer when you want to use to track QObjects, just like original Qt 4.0
- QWeakPointer when you want to track a QSharedPointer
The QWeakPointer constructor that takes a QObject is deprecated.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: This is a digitally signed message part.
More information about the Interest