Obsolete Members for QScopedPointer

QScopedPointer クラスの以下のメンバーは非推奨となっています。これらは、古いソースコードが引き続き動作するように提供されているものです。新しいコードでの使用は強く推奨しません。

パブリック関数

(deprecated in 6.2) void swap(QScopedPointer<T, Cleanup> &other)
(deprecated in 6.1) T *take()

関連する非メンバー関数

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

メンバー関数のドキュメント

[noexcept, deprecated in 6.2] void QScopedPointer::swap(QScopedPointer<T, Cleanup> &other)

この関数はバージョン 6.2 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

代わりに `std::unique_ptr ` を使用してください。この関数を使用すると、ポインタがスコープ外へ漏れ出る可能性があります。

このスコープ内のポインタとother を交換します。この操作は非常に高速で、失敗することはありません。

[noexcept, deprecated in 6.1] T *QScopedPointer::take()

この関数はバージョン 6.1 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

代わりに `std::unique_ptr ` および `release() ` を使用してください。

このオブジェクトが参照するポインタの値を返します。この `QScopedPointer ` オブジェクトのポインタは、`nullptr` にリセットされます。

この関数を呼び出す側は、そのポインタの所有権を取得します。

関連する非メンバー関数

[noexcept, deprecated in 6.2] void swap(QScopedPointer<T, Cleanup> &lhs, QScopedPointer<T, Cleanup> &rhs)

この関数はバージョン 6.2 以降、非推奨となっています。新しいコードでの使用は強く推奨しません。

代わりに `std::unique_ptr ` を使用してください。この関数では、ポインタがスコープから漏れ出す可能性があります。

lhs とrhs を入れ替えます。

© 2026 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.