Obsolete Members for QWeakPointer

以下成员源于类 QWeakPointer 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

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

成员函数文档编制

QWeakPointer:: QWeakPointer (const QObject * obj )

创建 QWeakPointer that holds a weak reference directly to the QObject obj . 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 .

该函数在 Qt 4.6 引入。

另请参阅 QSharedPointer and QPointer .

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

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

该函数在 Qt 4.6 引入。

另请参阅 QPointer .