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

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

#include <qvariant.h>

Collaboration diagram for QVariant::Reference< Indirect >:

Public Member Functions

 Reference (const Indirect &referred) noexcept(std::is_nothrow_copy_constructible_v< Indirect >)
 Creates a QVariant::Reference from a referred.
 Reference (Indirect &&referred) noexcept(std::is_nothrow_move_constructible_v< Indirect >)
 Creates a QVariant::Reference from a referred.
 Reference (const Reference &)=default
 Reference (Reference &&)=delete
 ~Reference ()=default
Referenceoperator= (const Reference &value) noexcept(Indirect::CanNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
Referenceoperator= (Reference &&value) noexcept(Indirect::CanNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
Referenceoperator= (const ConstReference< Indirect > &value) noexcept(Indirect::CanNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
Referenceoperator= (ConstReference< Indirect > &&value) noexcept(Indirect::CanNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
 operator QVariant () const noexcept(Indirect::CanNoexceptConvertToQVariant)
 Dereferences the reference to a QVariant.
void swap (Reference b)
Referenceoperator= (const QVariant &value) noexcept(Indirect::CanNoexceptAssignQVariant)
 Assigns a new value to the value referred to by this QVariant::Reference.
 operator QVariant () const
QVariant::Reference< QtMetaContainerPrivate::AssociativeIterator > & operator= (const QVariant &value)
 operator QVariant () const
QVariant::Reference< QtMetaContainerPrivate::SequentialIterator > & operator= (const QVariant &value)

Friends

class ConstReference< Indirect >
void swap (Reference a, Reference b)

Detailed Description

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

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<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::Iterator and QMetaAssociation::Iterator.

Definition at line 279 of file qvariant.h.

Constructor & Destructor Documentation

◆ Reference() [1/4]

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

Creates a QVariant::Reference from a referred.

Definition at line 290 of file qvariant.h.

◆ Reference() [2/4]

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

Creates a QVariant::Reference from a referred.

Definition at line 293 of file qvariant.h.

◆ Reference() [3/4]

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

◆ Reference() [4/4]

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

◆ ~Reference()

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

Member Function Documentation

◆ operator QVariant() [1/3]

Definition at line 95 of file qmetaassociation.h.

◆ operator QVariant() [2/3]

Definition at line 67 of file qmetasequence.h.

◆ operator QVariant() [3/3]

template<typename Indirect>
QVariant::Reference< Indirect >::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 330 of file qvariant.h.

◆ operator=() [1/7]

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

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

Definition at line 318 of file qvariant.h.

◆ operator=() [2/7]

◆ operator=() [3/7]

◆ operator=() [4/7]

template<typename Indirect>
Reference & QVariant::Reference< Indirect >::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 Indirect type. It is pre-defined for QMetaSequence::Iterator and QMetaAssociation::Iterator.

◆ operator=() [5/7]

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

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

Definition at line 306 of file qvariant.h.

◆ operator=() [6/7]

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

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

Definition at line 324 of file qvariant.h.

◆ operator=() [7/7]

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

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

Definition at line 312 of file qvariant.h.

◆ swap()

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

Definition at line 335 of file qvariant.h.

◆ ConstReference< Indirect >

template<typename Indirect>
friend class ConstReference< Indirect >
friend

Definition at line 275 of file qvariant.h.

◆ swap

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

Definition at line 285 of file qvariant.h.


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