QVariantRef Class
template <typename Pointer> class QVariantRefLe type `QVariantRef` correspond à une référence non constante à un objet de type ` QVariant`. En savoir plus...
| En-tête : | #include <qvariant.h> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake : | QT += core |
| Depuis : | Qt 6.0 |
| Statut : | Jusqu'à la version 6.15 |
Cette classe est prévue pour être obsolète dans la version 6.15.
Fonctions publiques
| 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) |
Description détaillée
Utilisez plutôt QVariant::Reference.
Comme les itérateurs génériques n’instancient pas réellement un QVariant à chaque étape, ils ne peuvent pas renvoyer de référence à celui-ci via l’opérateur *(). QVariantRef offre la même fonctionnalité qu'une référence réelle à un QVariant, mais s'appuie sur un pointeur de type Pointer. Le modèle est implémenté pour les pointeurs de type QSequentialIterator et QAssociativeIterator.
Documentation des fonctions membres
[explicit] QVariantRef::QVariantRef(const Pointer *pointer)
Crée un objet `QVariantRef` à partir d'un objet ` pointer`.
[default] QVariantRef::QVariantRef(const QVariantRef<Pointer> &)
Copie et construit une instance de ` QVariantRef`.
[default] QVariantRef::QVariantRef(QVariantRef<Pointer> &&)
Crée par la méthode « move » une instance de ` QVariantRef`.
[default] QVariantRef::~QVariantRef()
Supprime l'instance de ` QVariantRef`.
QVariantRef::operator QVariant() const
Convertit l'adresse QVariantRef en l'adresse réelle QVariant.
QVariantRef<Pointer> &QVariantRef::operator=(QVariantRef<Pointer> &&value)
Attribue une nouvelle instance de ` value ` à la valeur pointée par le pointeur auquel cette méthode ` QVariantRef ` fait référence.
QVariantRef<Pointer> &QVariantRef::operator=(const QVariant &value)
Attribue une nouvelle instance de ` value ` à la valeur pointée par le pointeur auquel renvoie ` QVariantRef `.
QVariantRef<Pointer> &QVariantRef::operator=(const QVariantRef<Pointer> &value)
Attribue une nouvelle instance de ` value ` à la valeur pointée par le pointeur auquel cette ` QVariantRef ` fait référence.
© 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.