このページでは

QVariantPointer Class

template <typename Pointer> class QVariantPointer

QVariantPointer は、ポインタに基づいて `QVariant ` へのポインタをエミュレートするテンプレートクラスです。詳細...

ヘッダー: #include <qvariant.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
以下のように: Qt 6.0
ステータス: 6.15まで

このクラスはバージョン 6.15 で非推奨となる予定です。

パブリック関数

QVariantPointer(const Pointer *pointer)
QVariantRef<Pointer> operator*() const
Pointer operator->() const

詳細な説明

代わりに `QVariant::Pointer ` を使用してください。

QVariantPointer<Pointer> は、Pointer 型のポインタをラップし、その演算子 *() からQVariantRef を返します。これにより、実際のポインタの代替として適しています。ジェネリックイテレータは実際のQVariant を保持していないため、ジェネリックイテレータから実際のポインタを返すことはできません。

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

[explicit] QVariantPointer::QVariantPointer(const Pointer *pointer)

指定されたpointer からQVariantPointerを生成します。

QVariantRef<Pointer> QVariantPointer::operator*() const

QVariantPointer をQVariantRef に変換します。

Pointer QVariantPointer::operator->() const

ポインタの参照を解除し、そのポインタを返します。このポインタは、operator->() も実装している必要があります。

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