Qt QML Models QML Types

此 QML 模块包含在 QML 中定义数据模型的类型。

要使用该模块中的类型,请用下面一行导入该模块:

import QtQml.Models

注: QtQml.Models 模块从 2.1 版开始,以匹配父模块的版本、 Qt Qml.

此外,Qt.labs.qmlmodels 为模型提供了实验性 QML 类型。要使用这些实验类型,请用下面一行导入该模块:

import Qt.labs.qmlmodels

QML 类型

DelegateModel

封装一个模型和委托

DelegateModelGroup

封装一组过滤后的可视化数据项

Instantiator

动态创建对象

ItemSelectionModel

实例化 QItemSelectionModel,与 QAbstractItemModel 和任何支持它的视图结合使用

ListElement

在 ListModel 中定义一个数据项

ListModel

定义自由格式列表数据源

ObjectModel

定义作为模型使用的项目集

Package

指定已命名项的集合

实验性 QML 类型

DelegateChoice

封装委托以及何时使用委托

DelegateChooser

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

TableModel

封装一个简单的表格模型

TableModelColumn

代表模型中的一列

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