Qt QML QML 类型

The Qt QML module provides the definition and implementation of various convenience types that can be used with the QML language. This includes elementary QML types, which can provide the basis for further extensions to the QML language. The QtObject and Component object types are non-visual and provide building-blocks for extensions to QML.

导入 QtQml

类型提供通过 QtQml module are only available in a QML document if that document imports the QtQml namespace (or if the document imports the QtQuick namespace, as noted below).

要使用模块,import QtQml 模块采用以下语句:

import QtQml
					

Most clients will never need to use the QtQml import, as all of the types are also provided by the QtQuick namespace, which may be imported as follows:

import QtQuick
					

Qt Quick module documentation for more information about the QtQuick namespace and what it provides to QML application developers.

The QML types for creating lists and models, such as ListModel and ListElement , are moved to a submodule, QtQml.Models Qt QML Models 页面有更多信息。

The documentation for the types below applies equally to the types of the same name provided by the Qt Quick module, as they are in fact identical.

值类型

下列 QML 值类型 有提供:

point 具有 X 和 Y 属性的值
rect 具有 X、Y、宽度及高度属性的值
size 具有宽度和高度属性的值

对象类型

下列 QML 对象类型 有提供:

Binding 使能够创建任意特性绑定
Component 封装 QML 组件定义
Connections 描述信号的一般化连接
Date 提供日期函数
Locale 提供特定区域设置的特性和格式化数据
LoggingCategory 定义 QML 日志类别
Number 提供表示数字值的对象
Qt 提供带有有用 Qt 枚举和函数的全局对象
QtObject 基本 QML 类型
Timer 按指定间隔触发处理程序
XMLHttpRequest 用于向服务器发送请求的对象