Qt Qml Models QML Types

该 QML 模块包含用于在 QML 中定义数据模型的类型。

要使用该模块中的类型,请使用以下语句导入该模块:

import QtQml.Models

AllOfFilter

在 SortFilterProxyModel 中使用逻辑“与”运算组合多个过滤器

AnyOfFilter

在 SortFilterProxyModel 中使用逻辑“或”运算结合多个过滤器

DelegateChoice

封装了一个委托及其使用场景

DelegateChooser

允许视图针对模型中不同类型的项目使用不同的委托

DelegateModel

封装模型和委托

DelegateModelGroup

封装一组经过筛选的可视化数据项

FilterBase

提供过滤器通用功能的抽象基类

FunctionFilter

根据对指定“filter”方法的评估,对 SortFilterProxyModel 中的数据进行过滤

Instantiator

动态创建对象

ItemSelectionModel

实例化一个 QItemSelectionModel,用于与 QAbstractItemModel 以及任何支持它的视图配合使用

ListElement

在 ListModel 中定义数据项

ListModel

定义自由格式列表数据源

ObjectModel

定义一组用作模型的项目

Package

指定一组命名项

RangeFilter

通过测试角色值是否落在给定范围内,对 SortFilterProxyModel 中的数据进行过滤

RegExpFilter

通过将角色值与正则表达式进行匹配,对 SortFilterProxyModel 中的数据进行过滤

RoleFilter

提供角色相关筛选功能的抽象基类

RoleSorter

根据配置的角色名称对 SortFilterProxyModel 中的数据进行排序

SortFilterProxyModel

为 QAbstractItemModel 提供排序和过滤功能

Sorter

提供排序器通用功能的抽象基类

StringSorter

根据区域设置的排序规则对 SortFilterProxyModel 中的数据进行排序

ValueFilter

根据角色名称和值对 SortFilterProxyModel 中的数据进行过滤

© 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.