总体上,qml的数据类型分为基本数据类型和对象类型,基本类型用于表示简单的值,其中一部分由qml语言提供,另一部分来自qml模块。
qml对象类型指类的实例,又分为qml对象类型和javascript对象,qml引擎支持几乎所有的javascript标准对象
一、基本数据类型
1.1 qml提供的基本数据类型
Binary true/false value | |
Number with a decimal point, stored in double precision | |
Named enumeration value | |
Whole number, e.g. 0, 10, or -20 | |
List of QML objects | |
Number with a decimal point | |
Free form text string | |
Resource locator | |
Generic property type |
1.2 qml模块提供的基本类型
Date value | |
Value with x and y attributes | |
Value with x, y, width and height attributes | |
Value with width and height attributes | |
ARGB color value. The type refers to an ARGB color value. It can be specified in a number of ways: | |
Font value with the properties of QFont. The type refers to a font value with the properties of QFont | |
A matrix4x4 type is a 4-row and 4-column matrix | |
A quaternion type has scalar, x, y, and z attributes | |
A vector2d type has x and y attributes | |
Value with x, y, and z attributes | |
A vector4d type has x, y, z and w attributes |
二、对象类型
2.1 qml对象类型
Provides date functions | |
Object provides represents a number value | |
Object represents a string value | |
Encapsulates a QML component definition | |
Provides a global object with useful enums and functions from Qt | |
A basic QML type | |
Provides locale specific properties and formatted data | |
Enables the arbitrary creation of property bindings | |
Describes generalized connections to signals | |
Dynamically creates objects | |
Triggers a handler at a specified interval |
2.2 javascript对象