このページでは

QVariantRef Class

template <typename Pointer> class QVariantRef

QVariantRefは、QVariant へのconstでない参照として機能する

ヘッダー #include <QVariantRef>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
以来:Qt 6.0
ステータス6.15 まで

このクラスはバージョン 6.15 で廃止予定です。

パブリック関数

QVariantRef(const Pointer *pointer)
operator QVariant() const
QVariantRef<Pointer> &operator=(QVariantRef<Pointer> &&value)
QVariantRef<Pointer> &operator=(const QVariant &value)
QVariantRef<Pointer> &operator=(const QVariantRef<Pointer> &value)

詳細な説明

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

ジェネリック・イテレータは各ステップで実際にQVariant をインスタンス化しないため、operator*() からその参照を返すことはできません。QVariantRef は、QVariant への実際の参照と同じ機能を提供しますが、テンプレート・パラメータとして与えられるポインタによってバッキングされます。このテンプレートは、QSequentialIterator および QAssociativeIterator 型のポインタに対して実装されています。

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

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

pointer から QVariantRef を作成します。

QVariantRef::operator QVariant() const

QVariantRef を実際のQVariant に解決する。

QVariantRef<Pointer> &QVariantRef::operator=(QVariantRef<Pointer> &&value)

このQVariantRef が指すポインタが指す値に、新しいvalue を代入する。

QVariantRef<Pointer> &QVariantRef::operator=(const QVariant &value)

このQVariantRef が指すポインタが指す値に、新しいvalue を代入する。

QVariantRef<Pointer> &QVariantRef::operator=(const QVariantRef<Pointer> &value)

このQVariantRef が指すポインタが指す値に、新しいvalue を代入する。

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