Hello

QPointer was ported to a QWeakPointer backend and deprecated early in Qt 5
history. However, QPointer is used throughout our code and, I can expect, in
user code too. Replacing it with QWeakPointer is just monkey work, adding
.data() everywhere and buying us no better safety (because no one will bother
to verify that the pointer could be got at that point). After the port to
QWeakPointer, QPointer is no longer slow either.

I'd like to suggest we un-deprecate it and bring it back to full status. 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.

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.

--
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

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to