Sur cette page

QVariantPointer Class

template <typename Pointer> class QVariantPointer

QVariantPointer est une classe modèle qui émule un pointeur vers QVariant basé sur un pointeur. Plus d'informations...

En-tête : #include <QVariantPointer>
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

QVariantPointer(const Pointer *pointer)
QVariantRef<Pointer> operator*() const
Pointer operator->() const

Description détaillée

Utilisez QVariant::Pointer à la place.

QVariantConstPointer Enveloppe un pointeur et lui renvoie QVariantRef à partir de son operator*(). Cela permet de remplacer un pointeur réel. Il n'est pas possible de renvoyer un pointeur réel à partir d'itérateurs génériques, car ces derniers ne contiennent pas de QVariant.

Documentation sur les fonctions membres

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

Construit un QVariantPointer à partir de pointer.

QVariantRef<Pointer> QVariantPointer::operator*() const

Déférence le site QVariantPointer à un site QVariantRef.

Pointer QVariantPointer::operator->() const

Déréférence et renvoie le pointeur. Le pointeur doit également implémenter operator->().

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