Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QVariant::ConstReference< Referred > Class Template Reference

The QVariant::ConstReference acts as a const reference to a QVariant. More...

#include <qvariant.h>

Collaboration diagram for QVariant::ConstReference< Referred >:

Public Member Functions

 ConstReference (const Referred &referred) noexcept(std::is_nothrow_copy_constructible_v< Referred >)
 Creates a QVariant::ConstReference from a referred.
 ConstReference (Referred &&referred) noexcept(std::is_nothrow_move_constructible_v< Referred >)
 Creates a QVariant::ConstReference from a referred.
 ConstReference (const ConstReference &)=default
 ConstReference (ConstReference &&)=default
 ~ConstReference ()=default
ConstReferenceoperator= (const ConstReference &value)=delete
ConstReferenceoperator= (ConstReference &&value)=delete
 operator QVariant () const noexcept(Referred::canNoexceptConvertToQVariant)
 Dereferences the reference to a QVariant.

Detailed Description

template<typename Referred>
class QVariant::ConstReference< Referred >

The QVariant::ConstReference acts as a const reference to a QVariant.

Since
6.11 \inmodule QtCore

As the generic iterators don't actually instantiate a QVariant on each step, they cannot return a reference to one from operator*(). QVariant::ConstReference provides the same functionality as an actual reference to a QVariant would, but is backed a referred-to value given as template parameter. The template is implemented for QMetaSequence::ConstIterator, QMetaSequence::Iterator, QMetaAssociation::ConstIterator, and QMetaAssociation::Iterator.

Definition at line 245 of file qvariant.h.

Constructor & Destructor Documentation

◆ ConstReference() [1/4]

template<typename Referred>
QVariant::ConstReference< Referred >::ConstReference ( const Referred & referred)
inlineexplicitnoexcept

Creates a QVariant::ConstReference from a referred.

Definition at line 253 of file qvariant.h.

◆ ConstReference() [2/4]

template<typename Referred>
QVariant::ConstReference< Referred >::ConstReference ( Referred && referred)
inlineexplicitnoexcept

Creates a QVariant::ConstReference from a referred.

Definition at line 256 of file qvariant.h.

◆ ConstReference() [3/4]

template<typename Referred>
QVariant::ConstReference< Referred >::ConstReference ( const ConstReference< Referred > & )
default

◆ ConstReference() [4/4]

template<typename Referred>
QVariant::ConstReference< Referred >::ConstReference ( ConstReference< Referred > && )
default

◆ ~ConstReference()

template<typename Referred>
QVariant::ConstReference< Referred >::~ConstReference ( )
default

Member Function Documentation

◆ operator QVariant()

template<typename Referred>
QVariant::ConstReference< Referred >::operator QVariant ( ) const
noexcept

Dereferences the reference to a QVariant.

This method needs to be specialized for each Referred type. It is pre-defined for QMetaSequence::ConstIterator, QMetaSequence::Iterator, QMetaAssociation::ConstIterator, and QMetaAssociation::Iterator.

◆ operator=() [1/2]

template<typename Referred>
ConstReference & QVariant::ConstReference< Referred >::operator= ( const ConstReference< Referred > & value)
delete

◆ operator=() [2/2]

template<typename Referred>
ConstReference & QVariant::ConstReference< Referred >::operator= ( ConstReference< Referred > && value)
delete

The documentation for this class was generated from the following files: