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 组件 object types are non-visual and provide building-blocks for extensions to QML.
The types provided by the
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 Value Types are provided:
point | Value with x and y attributes |
rect | Value with x, y, width and height attributes |
size | Value with width and height attributes |
下列 QML 对象类型 are provided:
Binding | 使能够创建任意特性绑定 |
组件 | 封装 QML 组件定义 |
Connections | 描述信号的一般化连接 |
Date | 提供日期函数 |
区域设置 | 提供特定区域设置的特性和格式化数据 |
LoggingCategory | 定义 QML 日志类别 |
Number | 提供表示数字值的对象 |
Qt | 提供带有有用 Qt 枚举和函数的全局对象 |
QtObject | 基本 QML 类型 |
Timer | 按指定间隔触发处理程序 |
XMLHttpRequest | Object for sending requests to a server |