- QPointer
- * QPointer itself is now deprecated, and the implementation of QPointer
- has been changed to use QWeakPointer. The old guard mechanism has been
- removed. This causes two slight changes in behavior when using
- QPointer:
+ * The implementation of QPointer has been changed to use QWeakPointer. The
+ old guard mechanism has been removed. This causes a slight change
+ in behavior when using QPointer:
* When using QPointer on a QWidget (or a subclass of QWidget), previously
the QPointer would be cleared by the QWidget destructor. Now, the QPointer
cleared). Any QPointers tracking a widget will NOT be cleared before the
QWidget destructor destroys the children for the widget being tracked.
- * When constructing a QSharedPointer to take ownership of an object after a
- QPointer is already tracking the object. Previously, the shared pointer
- construction would not be affected by the QPointer, but now that QPointer
- is implemented using QWeakPoiner, constructing the QSharedPointer will
- cause an abort().
-
- QVariant
destroyed while you still hold a reference to it. You can safely
test the pointer for validity.
- Note that Qt 5 introduces two slight changes in behavior when using QPointer.
+ Note that Qt 5 introduces a slight change in behavior when using QPointer.
\list
cleared). Any QPointers tracking a widget will \b NOT be cleared before the
QWidget destructor destroys the children for the widget being tracked.
- \li When constructing a QSharedPointer to take ownership of an object after a
- QPointer is already tracking the object. Previously, the shared pointer
- construction would not be affected by the QPointer, but now that QPointer
- is implemented using QWeakPoiner, constructing the QSharedPointer will
- cause an \c abort().
-
\endlist
Qt also provides QSharedPointer, an implementation of a reference-counted