このページでは

QVariantRef Class

template <typename Pointer> class QVariantRef

QVariantRef は、QVariant への非const参照として機能します。詳細...

ヘッダー: #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 で非推奨となる予定です。

パブリック関数

QVariantRef(const Pointer *pointer)
QVariantRef(const QVariantRef<Pointer> &)
QVariantRef(QVariantRef<Pointer> &&)
~QVariantRef()
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 への実際の参照と同じ機能を提供しますが、Pointer 型のポインタによって裏付けられています。このテンプレートは、QSequentialIterator および QAssociativeIterator 型のポインタに対して実装されています。

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

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

pointer からQVariantRefを作成します。

[default] QVariantRef::QVariantRef(const QVariantRef<Pointer> &)

QVariantRef のインスタンスをコピーして生成します。

[default] QVariantRef::QVariantRef(QVariantRef<Pointer> &&)

QVariantRef のインスタンスをMoveコンストラクタで生成します。

[default] QVariantRef::~QVariantRef()

QVariantRef のインスタンスを破棄します。

QVariantRef::operator QVariant() const

QVariantRef を実際のQVariant に変換します。

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

ポインタ `this`QVariantRef が指す値に、新しい `value ` を代入します。

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

ポインタ `this`QVariantRef が指す値に、新しい `value ` を代入します。

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

ポインタ `this`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.