本页内容

QRangeModelAdapter::RowReferenceBase Struct

template <typename Reference, typename Adapter> struct QRangeModelAdapter::RowReferenceBase

RowReferenceBase 为RowReference 和ConstRowReference 提供了通用 API。更多内容...

该结构体处于技术预览阶段,未来可能会有变动。

该结构体首次出现在 Qt 6.11 中。

公共函数

auto at(int column) const
QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator begin() const
QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator cbegin() const
QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator cend() const
auto children() const
QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator end() const
bool hasChildren() const
QRangeModelAdapter<Range, Protocol, Model>::RowReferenceBase<Reference, Adapter>::size_type size() const
auto operator[](int column) const

受保护函数

详细说明

对于表或树模型,使用at()、下标operator[] 或解引用RowIterator 来访问适配器的一行,将返回指向指定行的RowReference 或ConstRowReference 。

另请参阅 DataReference 。

成员函数文档

[protected default] RowReferenceBase::~RowReferenceBase()

销毁RowReferenceBase 的实例。

auto RowReferenceBase::at(int column) const

auto RowReferenceBase::operator[](int column) const

返回指向该行中位于column 处项的引用包装器。

根据适配器所操作的数据结构,返回值可能是 const 引用包装器、指向 const 对象的指针,或者是一个QVariant 。

QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator RowReferenceBase::begin() const

返回一个指向该行第一列的ConstColumnIterator 。

QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator RowReferenceBase::cbegin() const

返回一个指向该行第一列的ConstColumnIterator 。

QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator RowReferenceBase::cend() const

返回一个ConstColumnIterator ,其指针指向该行最后一列的紧后方。

template <typename I> requires if_tree<I> auto RowReferenceBase::children() const

返回一个QRangeModelAdapter ,该 作用于与该适配器相同的范围和模型,并将该行作为根索引。

约束

仅当Range 为树时,才参与重载解析。

QRangeModelAdapter<Range, Protocol, Model>::ConstColumnIterator RowReferenceBase::end() const

返回一个ConstColumnIterator ,其指针指向该行最后一列的紧后方。

template <typename I> requires if_tree<I> bool RowReferenceBase::hasChildren() const

如果引用的行有一个或多个子行,则返回 true;否则返回 false。

约束

仅当Range 为树时,才参与重载解析。

QRangeModelAdapter<Range, Protocol, Model>::RowReferenceBase<Reference, Adapter>::size_type RowReferenceBase::size() const

返回模型中的列数。

该方法对模型中的所有行返回相同的值。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.