On this page

QVariant::ConstPointer Class

template <typename Pointed> class QVariant::ConstPointer

QVariant::ConstPointer is a template class that emulates a const pointer to QVariant. More...

This class was introduced in Qt 6.11.

Public Functions

ConstPointer(Pointed &&pointed)
ConstPointer(const Pointed &pointed)
QVariant::ConstReference<Pointed> operator*() const

Detailed Description

QVariant::ConstPointer wraps pointed-to value and returns a QVariant::ConstReference 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(...)] ConstPointer::ConstPointer(Pointed &&pointed)

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

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

[explicit noexcept(...)] ConstPointer::ConstPointer(const Pointed &pointed)

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

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

[noexcept(...)] QVariant::ConstReference<Pointed> ConstPointer::operator*() const

Dereferences the QVariant::ConstPointer to a QVariant::ConstReference.

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

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