Sur cette page

QVariantConstPointer Class

Pointeur `const` émulé vers ` QVariant ` à partir d'un pointeur. 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

QVariantConstPointer(QVariant variant)
QVariant operator*() const
const QVariant *operator->() const

Description détaillée

Utilisez plutôt QVariant::ConstPointer.

QVariantConstPointer encapsule un QVariant et le renvoie via son opérateur *(). Cela en fait un substitut approprié à un véritable pointeur const. Il n'est pas possible de renvoyer un véritable pointeur const à partir d'itérateurs génériques, car ceux-ci ne contiennent pas de véritable QVariant.

Documentation des fonctions membres

[explicit] QVariantConstPointer::QVariantConstPointer(QVariant variant)

Crée un objet `QVariantConstPointer` à partir d'un objet ` variant`.

QVariant QVariantConstPointer::operator*() const

Déréférence l'QVariantConstPointer pour récupérer son QVariant interne.

const QVariant *QVariantConstPointer::operator->() const

Renvoie un pointeur constant vers l’ QVariant, conforme aux conventions relatives à l’opérateur ->().

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