Obsolete Members for QWeakPointer

The following members of class QWeakPointer are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

Public Functions

(obsolete) QWeakPointer(const QObject *other)
(obsolete) QWeakPointer<T> &operator=(const QObject *other)

Member Function Documentation

QWeakPointer::QWeakPointer(const QObject *other)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Creates a QWeakPointer that holds a weak reference directly to the QObject other. This constructor is only available if the template type T is QObject or derives from it (otherwise a compilation error will result).

You can use this constructor with any QObject, even if they were not created with QSharedPointer.

Note that QWeakPointers created this way on arbitrary QObjects usually cannot be promoted to QSharedPointer.

This function was introduced in Qt 4.6.

See also QSharedPointer and QPointer.

QWeakPointer<T> &QWeakPointer::operator=(const QObject *other)

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

Makes this QWeakPointer hold a weak reference directly to the QObject other. This function is only available if the template type T is QObject or derives from it.

This function was introduced in Qt 4.6.

See also QPointer.

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.