[Development] Undeprecating QPointer
Thiago Macieira
thiago.macieira at intel.com
Fri Mar 2 13:46:56 CET 2012
On sexta-feira, 2 de março de 2012 12.20.05, Olivier Goffart wrote:
> > I'd like to suggest we un-deprecate it and bring it back to full status.
>
> I agree.
Anyone objects?
> I have been trying to compile qtbase without the deprecated symbols, and two
> issues remains that i could not solve: QPointer, and QWheelEvent's
> deprecated member.
There's also the QImageTextLang deprecation, but I've got a patch for that. It
basically involves deprecating the constructors instead of the entire type.
> The alternative would be to add operator-> and operator T* to QWeakPointer,
> which would allow do do simply s/QPointer/QWeakPointer/g
> I personaly beleive this would actually be the best option.
I don't, because that would detract from QWeakPointer's original mission.
You're not supposed to access the pointer stored in a QWeakPointer without
first promoting it to QSharedPointer. The .data() access was a concession to
handling QObjects when QPointer was hellish slow in Qt 4.
> > At the same time, I'd like to suggest we discourage using QWeakPointer for
> > tracking QObjects, instead leaving it to its original purpose of being the
> > weak reference counterpart to QSharedPointer.
>
> Indeed, we should not have two class with the same purpose. So if QPointer
> stays, QWeakPointer have to leave.
"Leave" in the sense of "stop handling QObjects". It has another, main purpose
which means it stays undeprecated.
> > I'm not going as far as suggesting we deprecate the QWeakPointer(QObject*)
> > constructor yet. I need to do a bit of research on how a future
> > QSharedPointer & QWeakPointer with full "enable_shared_from_this" and
> > QObject tracking would look like.
>
> One problem: QPointer use QWeakPointer inline, meaning it can hardly be done
> without QWeakPointer in the future.
True, but QPointer might as well use some of the internals and avoid warnings.
--
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...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120302/d3b46545/attachment.sig>
More information about the Development
mailing list