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::Reference< Referred > Class Template Reference

The QVariant::Reference acts as a non-const reference to a QVariant. More...

#include <qvariant.h>

Collaboration diagram for QVariant::Reference< Referred >:

Public Member Functions

 Reference (const Referred &referred) noexcept(std::is_nothrow_copy_constructible_v< Referred >)
 Creates a QVariant::Reference from a referred.
 Reference (Referred &&referred) noexcept(std::is_nothrow_move_constructible_v< Referred >)
 Creates a QVariant::Reference from a referred.
 Reference (const Reference &)=default
 Reference (Reference &&)=default
 ~Reference ()=default
Referenceoperator= (const Reference &value) noexcept(Referred::canNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
Referenceoperator= (Reference &&value) noexcept(Referred::canNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
 operator QVariant () const noexcept(Referred::canNoexceptConvertToQVariant)
 Dereferences the reference to a QVariant.
void swap (Reference b)
Referenceoperator= (const QVariant &value) noexcept(Referred::canNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.

Friends

void swap (Reference a, Reference b)

Detailed Description

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

The QVariant::Reference acts as a non-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::Reference 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::Iterator and QMetaAssociation::Iterator.

Definition at line 270 of file qvariant.h.

Constructor & Destructor Documentation

◆ Reference() [1/4]

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

Creates a QVariant::Reference from a referred.

Definition at line 280 of file qvariant.h.

◆ Reference() [2/4]

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

Creates a QVariant::Reference from a referred.

Definition at line 283 of file qvariant.h.

◆ Reference() [3/4]

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

◆ Reference() [4/4]

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

◆ ~Reference()

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

Member Function Documentation

◆ operator QVariant()

template<typename Referred>
QVariant::Reference< Referred >::operator QVariant ( ) const
inlinenoexcept

Dereferences the reference to a QVariant.

By default this instantiates a temporary QVariant::ConstReference and calls dereferences that. In cases where instantiating a temporary ConstReference is expensive, this method should be specialized.

Definition at line 302 of file qvariant.h.

◆ operator=() [1/3]

template<typename Referred>
Reference & QVariant::Reference< Referred >::operator= ( const QVariant & value)
noexcept

Assigns a new value to the value referred to by this QVariant::Reference.

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

◆ operator=() [2/3]

template<typename Referred>
Reference & QVariant::Reference< Referred >::operator= ( const Reference< Referred > & value)
inlinenoexcept

Assigns a new value to the value referred to by this QVariant::Reference.

Definition at line 290 of file qvariant.h.

◆ operator=() [3/3]

template<typename Referred>
Reference & QVariant::Reference< Referred >::operator= ( Reference< Referred > && value)
inlinenoexcept

Assigns a new value to the value referred to by this QVariant::Reference.

Definition at line 296 of file qvariant.h.

◆ swap()

template<typename Referred>
void QVariant::Reference< Referred >::swap ( Reference< Referred > b)
inline

Definition at line 307 of file qvariant.h.

◆ swap

template<typename Referred>
void swap ( Reference< Referred > a,
Reference< Referred > b )
friend

Definition at line 275 of file qvariant.h.


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