QVariant::ConstReference Class
template <typename Indirect> class QVariant::ConstReferenceLe QVariant::ConstReference agit comme une référence constante à un QVariant... Plus...
Cette classe a été introduite dans Qt 6.11.
Fonctions publiques
| ConstReference(Indirect &&referred) | |
| ConstReference(QVariant::Reference<Indirect> &&nonConst) | |
| ConstReference(const Indirect &referred) | |
| ConstReference(const QVariant::Reference<Indirect> &nonConst) | |
| operator QVariant() const |
Description détaillée
Comme les itérateurs génériques n'instancient pas réellement un QVariant à chaque étape, ils ne peuvent pas renvoyer une référence à l'un d'entre eux à partir de operator*(). QVariant::ConstReference fournit la même fonctionnalité qu'une référence réelle à un QVariant, mais est soutenu par une valeur référencée donnée en tant que paramètre de modèle. Le modèle est implémenté pour QMetaSequence::ConstIterator, QMetaSequence::Iterator, QMetaAssociation::ConstIterator, et QMetaAssociation::Iterator.
Documentation des fonctions membres
[explicit noexcept(...)] ConstReference::ConstReference(Indirect &&referred)
Crée un QVariant::ConstReference à partir d'un referred.
Note : Cette fonction est noexcept lorsque std::is_nothrow_move_constructible_v<Indirect> est true.
[default] ConstReference::ConstReference(QVariant::Reference<Indirect> &&nonConst)
Crée un site QVariant::ConstReference à partir d'une référence nonConst.
[explicit noexcept(...)] ConstReference::ConstReference(const Indirect &referred)
Crée un QVariant::ConstReference à partir d'un referred.
Note : Cette fonction est noexcept lorsque std::is_nothrow_copy_constructible_v<Indirect> est true.
[noexcept(...)] ConstReference::ConstReference(const QVariant::Reference<Indirect> &nonConst)
Crée un QVariant::ConstReference à partir d'une référence nonConst.
Note : Cette fonction est noexcept lorsque std::is_nothrow_copy_constructible_v<Indirect> est true.
[noexcept(...)] ConstReference::operator QVariant() const
Déréférence la référence à un QVariant. Cette méthode doit être spécialisée pour chaque type Indirect. Elle est prédéfinie pour QMetaSequence::ConstIterator, QMetaSequence::Iterator, QMetaAssociation::ConstIterator, et QMetaAssociation::Iterator.
Remarque : cette fonction est noexcept lorsque Indirect::CanNoexceptConvertToQVariant est true.
© 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.