Qt Qml QML Types
该 Qt Qml模块提供了可与 QML 语言一起使用的各种方便类型的定义和实现。这包括基本 QML 类型,可为进一步扩展 QML 语言提供基础。QtObject 和Component 对象类型是非可视的,为 QML 的扩展提供了基石。
导入 QtQml
QtQml
模块提供的类型只有在 QML 文档导入了QtQml
命名空间(或导入了QtQuick
命名空间,如下所述)时才能在 QML 文档中使用。
要使用该模块,请在导入QtQml
模块时使用以下语句:
import QtQml
许多客户永远不需要直接使用QtQml
模块,而是通过QtQuick
模块间接导入,如下所示:
import QtQuick
有关 Qt Quick模块文档,了解有关其类型的更多信息。
用于创建列表和模型的 QML 类型,如ListModel 和ListElement ,属于子模块QtQml.Models 。
WorkerScript QML 类型属于子模块QtQml.WorkerScript 。
只要导入QtQml
,就会自动导入QtQml.Models 和QtQml.WorkerScript 。它们的所有类型也都可用。
该 Qt Quick模块会自动导入QtQml
以及QtQml.Models 和QtQml.WorkerScript ,只要导入QtQuick
,它们的所有类型都可用。
值类型
提供了以下QML 值类型:
序列类型
除了与每个值类型和对象类型一起注册的类型外,Qt QML 模块还提供以下QML 序列类型:
std::vector<QString>
std::vector<QUrl>
std::vector<bool>
std::vector<int>
std::vector<float>
std::vector<double>
对象类型
提供了以下QML 对象类型:
可任意创建属性绑定 | |
封装 QML 组件定义 | |
描述与信号的通用连接 | |
提供日期函数 | |
提供本地特定属性和格式化数据 | |
在 QML 中定义日志类别 | |
提供代表数字值的对象 | |
提供一个全局对象,包含有用的枚举和 Qt 函数 | |
基本的 QML 类型 | |
在指定时间间隔触发处理程序 | |
向服务器发送请求的对象 |
© 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.