Qt QML 模型
此 QML 模块包含在 QML 中定义数据模型的类型。
要使用该模块中的类型,请用下面一行导入该模块:
import QtQml.Models
此外,Qt.labs.qmlmodels 为模型提供了实验性 QML 类型。要使用这些实验类型,请用下面一行导入该模块:
import Qt.labs.qmlmodels
QML 类型
封装委托以及何时使用委托 | |
允许视图对模型中不同类型的项目使用不同的委托 | |
封装一个模型和委托 | |
封装可视化数据项的过滤集 | |
抽象的基本类型,提供过滤器的通用功能 | |
根据指定的 "filter "方法的评估结果,过滤 SortFilterProxyModel 中的数据 | |
根据指定 "排序 "方法的评估结果,对 SortFilterProxyModel 中的数据进行排序 | |
动态创建对象 | |
实例化 QItemSelectionModel,与 QAbstractItemModel 和任何支持它的视图结合使用 | |
在 ListModel 中定义一个数据项 | |
定义自由格式列表数据源 | |
定义作为模型使用的项目集 | |
指定已命名项的集合 | |
抽象基本类型,为角色相关过滤器提供功能 | |
根据配置的角色名称对 SortFilterProxyModel 中的数据进行排序 | |
为 QAbstractItemModel 提供排序和筛选功能 | |
为排序器提供通用功能的抽象基础类型 | |
根据地域排序对 SortFilterProxyModel 中的数据进行排序 | |
根据角色名称和值过滤 SortFilterProxyModel 中的数据 |
实验性 QML 类型
封装简单的表格模型 | |
代表模型中的一列 | |
封装一个简单的树模型 |
许可证
Qt Qml Models 可在Qt 公司的商业许可下使用。此外,它还可以在GNU Lesser General Public License 第 3 版或GNU General Public License 第 2 版下使用。更多详情,请参阅Qt Licensing。
© 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.