- Qt 6.10
- Qt Core
- C++ Classes
- Pointer
- Qt 6.10.2 Reference Documentation

# QVariant::Pointer Class

template <typename Pointed> 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.

- List of all members, including inherited members

## Public Functions

| Pointer(Pointed &&pointed)
| Pointer(const Pointed &pointed)
QVariant::Reference<Pointed> | 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(Pointed &&pointed)

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

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

### `[explicit noexcept(...)]` Pointer::Pointer(const Pointed &pointed)

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

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

### `[noexcept(...)]` QVariant::Reference<Pointed> Pointer::operator*() const

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

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