QVariant::Reference Class

template <typename Referred> class QVariant ::Reference

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

This class was introduced in Qt 6.11.

公共函数

参考 (Referred && referred )
参考 (const Referred & referred )
QVariant operator QVariant () const
QVariant::Reference<Referred> & operator= (QVariant::Reference<Referred> && value )
QVariant::Reference<Referred> & operator= (const QVariant & value )
QVariant::Reference<Referred> & operator= (const QVariant::Reference<Referred> & value )

详细描述

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.

成员函数文档编制

[explicit noexcept(...)] Reference:: 参考 ( Referred && referred )

创建 QVariant::Reference referred .

注意: This function is noexcept when std::is_nothrow_move_constructible_v<Referred> is true .

[explicit noexcept(...)] Reference:: 参考 (const Referred & referred )

创建 QVariant::Reference referred .

注意: This function is noexcept when std::is_nothrow_copy_constructible_v<Referred> is true .

[noexcept(...)] QVariant Reference:: operator QVariant () const

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.

注意: This function is noexcept when Referred::canNoexceptConvertToQVariant is true .

[noexcept(...)] QVariant::Reference < Referred > &Reference:: operator= ( QVariant::Reference < Referred > && value )

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

注意: This function is noexcept when Referred::canNoexceptAssignQVariant is true .

[noexcept(...)] QVariant::Reference < Referred > &Reference:: operator= (const QVariant & value )

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.

注意: This function is noexcept when Referred::canNoexceptAssignQVariant is true .

[noexcept(...)] QVariant::Reference < Referred > &Reference:: operator= (const QVariant::Reference < Referred > & value )

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

注意: This function is noexcept when Referred::canNoexceptAssignQVariant is true .