QVariantRef Class
template <typename Pointer> class QVariantRefO QVariantRef funciona como uma referência não constante a um ` QVariant`. Mais...
| Cabeçalho: | #include <qvariant.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Desde: | Qt 6.0 |
| Status: | Até a versão 6.15 |
Esta classe está programada para ser descontinuada na versão 6.15.
Funções públicas
| 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) |
Descrição detalhada
Use ` QVariant::Reference ` em vez disso.
Como os iteradores genéricos não instanciam efetivamente um ` QVariant ` a cada passo, eles não podem retornar uma referência a um deles por meio do operador `*()`. QVariantRef oferece a mesma funcionalidade que uma referência real a um QVariant, mas é respaldado por um ponteiro do tipo Pointer. O modelo é implementado para ponteiros dos tipos QSequentialIterator e QAssociativeIterator.
Documentação das funções-membro
[explicit] QVariantRef::QVariantRef(const Pointer *pointer)
Cria um `QVariantRef` a partir de um ` pointer`.
[default] QVariantRef::QVariantRef(const QVariantRef<Pointer> &)
Cria uma instância de ` QVariantRef` por meio de cópia.
[default] QVariantRef::QVariantRef(QVariantRef<Pointer> &&)
Move cria uma instância de ` QVariantRef`.
[default] QVariantRef::~QVariantRef()
Destrói a instância de ` QVariantRef`.
QVariantRef::operator QVariant() const
Converte o endereço QVariantRef para o endereço real QVariant.
QVariantRef<Pointer> &QVariantRef::operator=(QVariantRef<Pointer> &&value)
Atribui um novo objeto ` value ` ao valor apontado pelo ponteiro `this` QVariantRef.
QVariantRef<Pointer> &QVariantRef::operator=(const QVariant &value)
Atribui um novo objeto ` value ` ao valor apontado pelo ponteiro ao qual ` QVariantRef ` se refere.
QVariantRef<Pointer> &QVariantRef::operator=(const QVariantRef<Pointer> &value)
Atribui um novo objeto ` value ` ao valor apontado pelo ponteiro ao qual este ` QVariantRef ` se refere.
© 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.