QVariant::Pointer Class

template <typename Indirect> class QVariant::Pointer

QVariant::Pointer is a template class that emulates a non-const pointer to QVariant. More...

This class was introduced in Qt 6.11.

Public Functions

Pointer(Indirect &&pointed)
Pointer(const Indirect &pointed)
operator QVariant::ConstPointer<Indirect>() const
QVariant::Reference<Indirect> operator*() const

Detailed Description

QVariant::Pointer wraps pointed-to value and returns a QVariant::Reference 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 noexcept(...)] Pointer::Pointer(Indirect &&pointed)

Constructs a QVariant::Pointer from the value pointed to.

Note: This function is noexcept when std::is_nothrow_move_constructible_v<Indirect> is true.

[explicit noexcept(...)] Pointer::Pointer(const Indirect &pointed)

Constructs a QVariant::Pointer from the value pointed to.

Note: This function is noexcept when std::is_nothrow_copy_constructible_v<Indirect> is true.

[noexcept(...)] Pointer::operator QVariant::ConstPointer<Indirect>() const

Converts this QVariant::Pointer into a QVariant::ConstPointer.

Note: This function is noexcept when std::is_nothrow_copy_constructible_v<Indirect> is true.

[noexcept(...)] QVariant::Reference<Indirect> Pointer::operator*() const

Dereferences the QVariant::Pointer to a QVariant::Reference.

Note: This function is noexcept when std::is_nothrow_copy_constructible_v<Indirect> is true.