이 페이지에서

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-construct로 생성합니다.

[default] QVariantRef::~QVariantRef()

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.