Obsolete Members for QScopedPointer

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

公共函数

(deprecated (6.1)) T * take ()

相关非成员

(deprecated (6.1)) void swap (QScopedPointer<T, Cleanup> & lhs , QScopedPointer<T, Cleanup> & rhs )

成员函数文档编制

T *QScopedPointer:: take ()

This function is deprecated since 6.1. We strongly advise against using it in new code.

使用 std::unique_ptr and release() 代替。

Returns the value of the pointer referenced by this object. The pointer of this QScopedPointer object will be reset to nullptr .

Callers of this function take ownership of the pointer.

相关非成员

void swap ( QScopedPointer < T , Cleanup > & lhs , QScopedPointer < T , Cleanup > & rhs )

This function is deprecated since 6.1. We strongly advise against using it in new code.

使用 std::unique_ptr instead; this function may let a pointer escape its scope.

交换 lhs with rhs .