IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QVariantPointer Class

QVariantPointer is a template class that emulates a pointer to QVariant based on a pointer.

This class was introduced in Qt 6.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QVariantPointer Class

  • Header: QVariantPointer

  • Since: Qt 6.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Core)

    target_link_libraries(mytarget PRIVATE Qt6::Core)

  • qmake: QT += core

Detailed Description

QVariantConstPointer wraps a pointer and returns QVariantRef to it from its operator*(). This makes it suitable as replacement for an actual pointer. We cannot return an actual pointer from generic iterators as the iterators don't hold an actual QVariant.

Member Function Documentation

 

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

Constructs a QVariantPointer from the given pointer.

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

Dereferences the QVariantPointer to a QVariantRef.

Pointer QVariantPointer::operator->() const

Dereferences and returns the pointer. The pointer is expected to also implement operator->().

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+