QVariant::ConstReference Class

template <typename Referred> class QVariant ::ConstReference

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

This class was introduced in Qt 6.11.

公共函数

ConstReference (Referred && referred )
ConstReference (const Referred & referred )
QVariant operator QVariant () const

详细描述

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.

成员函数文档编制

[explicit noexcept(...)] ConstReference:: ConstReference ( Referred && referred )

创建 QVariant::ConstReference referred .

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

[explicit noexcept(...)] ConstReference:: ConstReference (const Referred & referred )

创建 QVariant::ConstReference referred .

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

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

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.

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