Qml数据类型

本文详细介绍了QML的基本数据类型与对象类型,并列举了由QML语言本身及QML模块提供的各种类型,包括bool、double、enumeration等基本类型,以及Date、Number、String等对象类型。同时,还介绍了QML引擎支持的所有JavaScript标准对象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

总体上,qml的数据类型分为基本数据类型和对象类型,基本类型用于表示简单的值,其中一部分由qml语言提供,另一部分来自qml模块。

qml对象类型指类的实例,又分为qml对象类型和javascript对象,qml引擎支持几乎所有的javascript标准对象

一、基本数据类型

1.1 qml提供的基本数据类型

bool

Binary true/false value

double

Number with a decimal point, stored in double precision

enumeration

Named enumeration value

int

Whole number, e.g. 0, 10, or -20

list

List of QML objects

real

Number with a decimal point

string

Free form text string

url

Resource locator

var

Generic property type

 

1.2 qml模块提供的基本类型

date

Date value

point

Value with x and y attributes

rect

Value with x, y, width and height attributes

size

Value with width and height attributes

color

ARGB color value. The type refers to an ARGB color value. It can be specified in a number of ways:

font

Font value with the properties of QFont. The type refers to a font value with the properties of QFont

matrix4x4

A matrix4x4 type is a 4-row and 4-column matrix

quaternion

A quaternion type has scalar, x, y, and z attributes

vector2d

A vector2d type has x and y attributes

vector3d

Value with x, y, and z attributes

vector4d

A vector4d type has x, y, z and w attributes

 

二、对象类型

2.1 qml对象类型

Date

Provides date functions

Number

Object provides represents a number value

String

Object represents a string value

Component

Encapsulates a QML component definition

Qt

Provides a global object with useful enums and functions from Qt

QtObject

A basic QML type

Locale

Provides locale specific properties and formatted data

Binding

Enables the arbitrary creation of property bindings

Connections

Describes generalized connections to signals

Instantiator

Dynamically creates objects

Timer

Triggers a handler at a specified interval

 

2.2 javascript对象

http://blog.youkuaiyun.com/dalancon/article/details/7934688

 

转载于:https://my.oschina.net/assange/blog/730261

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值