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< Indirect > Class Template Reference

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

#include <qvariant.h>

Collaboration diagram for QVariant::ConstReference< Indirect >:

Public Member Functions

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

Friends

class Reference< Indirect >

Detailed Description

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

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<Indirect> provides the same functionality as an actual reference to a QVariant would, but is backed by a referred-to value of type Indirect. The template is implemented for QMetaSequence::ConstIterator, QMetaSequence::Iterator, QMetaAssociation::ConstIterator, and QMetaAssociation::Iterator.

Definition at line 237 of file qvariant.h.

Constructor & Destructor Documentation

◆ ConstReference() [1/5]

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

Creates a QVariant::ConstReference from a referred.

Definition at line 246 of file qvariant.h.

◆ ConstReference() [2/5]

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

Creates a QVariant::ConstReference from a referred.

Definition at line 249 of file qvariant.h.

◆ ConstReference() [3/5]

template<typename Indirect>
QVariant::ConstReference< Indirect >::ConstReference ( const ConstReference< Indirect > & ) const
defaultnoexcept

◆ ConstReference() [4/5]

template<typename Indirect>
QVariant::ConstReference< Indirect >::ConstReference ( ConstReference< Indirect > && )
delete

◆ ConstReference() [5/5]

template<typename Indirect>
QVariant::ConstReference< Indirect >::ConstReference ( const Reference< Indirect > & nonConst)
inlinenoexcept

Creates a QVariant::ConstReference from a nonConst Reference.

Definition at line 929 of file qvariant.h.

◆ ~ConstReference()

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

Member Function Documentation

◆ operator QVariant() [1/3]

◆ operator QVariant() [2/3]

Definition at line 84 of file qmetasequence.h.

◆ operator QVariant() [3/3]

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

Dereferences the reference to a QVariant.

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Reference< Indirect >

template<typename Indirect>
friend class Reference< Indirect >
friend

Definition at line 117 of file qvariant.h.


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