QML 术语表

QML 术语表

常用术语

术语定义
QMLThe language in which QML applications are written. The language architecture and engine are implemented by the Qt QML module. 编写 QML 应用程序的语言。语言架构和引擎由 Qt QML 模块实现。
Qt QuickThe standard library of types and functionality for the QML language, which is provided by the Qt Quick module, and may be accessed with "import QtQuick 2.3". QML 语言的类型和功能标准库,由 Qt Quick 模块提供,可以通过“import QtQuick 2.3”访问。
Type 类型In QML, a type may refer to either a Basic Type or a QML Object Type. The QML language provides a number of built-in basic types, and the Qt Quick module provides various Qt Quick types for building QML applications. Types can also be provided by third-party developers through (modules) or by the application developer in the application itself through QML Documents. See The QML Type System for more details. 在 QML 中,类型可以指基本类型或QML 对象类型。QML 语言提供了许多内置的基本类型,Qt Quick 模块提供了各种用于构建 QML 应用程序的Qt Quick 类型。类型也可以由第三方开发人员通过(模块)或应用程序开发人员通过QML 文档在应用程序本身中提供。有关更多详细信息,请参阅QML 类型系统。
Basic Type 基本类型A basic type is a simple type such as int, string and bool. Unlike object types, an object cannot be instantiated from a basic type; for example, it is not possible to create an int object with properties, methods, signals and so on. Basic types are built into the QML language, whereas object types cannot be used unless the appropriate module is imported. See The QML Type System for more details. 基本类型是简单类型,例如int,stringbool。与对象类型不同,对象不能从基本类型实例化;例如,不可能创建int具有属性、方法、信号等的对象。基本类型内置于 QML 语言中,而对象类型则不能使用,除非导入适当的模块。有关更多详细信息,请参阅QML 类型系统。
Object Type对象类型A QML Object Type is a type that can be instantiated by the QML engine. A QML type can be defined either by a document in a .qml file beginning with a capital letter, or by a QObject-based C++ class. See The QML Type System for more details. QML 对象类型是可以由 QML 引擎实例化的类型。QML 类型可以由 .qml 文件中以大写字母开头的文档定义,也可以由基于QObject的 C++ 类定义。有关更多详细信息,请参阅QML 类型系统。
Object 对象A QML object is an instance of a QML Object Type. Such objects are created by the engine when it processes object declarations, which specify the objects to be created and the attributes that are to be defined for each object. Additionally, objects can be dynamically created at runtime through Component.createObject() and Qt.createQmlObject(). See also Lazy Instantiation. QML 对象是QML 对象类型的一个实例。此类对象由引擎在处理对象声明时创建,该声明指定要创建的对象以及要为每个对象定义的属性。此外,可以在运行时通过 Component.createObject() 和 Qt.createQmlObject() 动态创建对象。另请参见延迟实例化。
Component 组件A component is a template from which a QML object or object tree is created. It is produced when a document is loaded by the QML engine. Once it has been loaded, it can be used to instantiate the object or object tree that it represents. Additionally, the Component type is a special type that can can be used to declare a component inline within a document. Component objects can also be dynamically created through Qt.createComponent() to dynamically create QML objects. 组件是创建 QML 对象或对象树的模板。它是在 QML 引擎加载文档时生成的。一旦它被加载,它就可以用来实例化它所代表的对象或对象树。此外,Component类型是一种特殊类型,可用于在文档中内联声明组件。组件对象也可以通过Qt.createComponent()动态创建,从而动态创建QML对象。
Document 文档A QML Document is a self contained piece of QML source code that begins with one or more import statements and contains a single top-level object declaration. A document may reside in a .qml file or a text string. If it is placed in a .qml file whose name begins with a capital letter, the file is recognized by the engine as a definition of a QML type. The top-level object declaration encapsulates the object tree that will be instantiated by the type. QML 文档是一段自包含的QML 源代码,它以一个或多个 import 语句开头,并包含一个顶级对象声明。文档可能驻留在 .qml 文件或文本字符串中。如果将其放置在名称以大写字母开头的 .qml 文件中,则该文件被引擎识别为 QML 类型的定义。顶级对象声明封装了将由该类型实例化的对象树。
Property 属性A property is an attribute of an object type that has a name and an associated value; this value can be read (and in most cases, also written to) externally. An object can have one or more properties. Some properties are associated with the canvas (e.g., x, y, width, height, and opacity) while others may be data specific to that type (e.g., the "text" property of the Text type). See QML Object Attributes for more details. 属性是具有名称和关联值的对象类型的属性;这个值可以从外部读取(并且在大多数情况下,也可以写入)。一个对象可以有一个或多个属性。一些属性与画布相关联(例如,x、y、宽度、高度和不透明度),而其他可能是特定于该类型的数据(例如,文本类型的“文本”属性)。有关更多详细信息,请参阅QML 对象属性。
Binding 绑定A binding is a JavaScript expression which is "bound" to a property. The value of the property at any point in time will be the value returned by evaluating that expression. See Property Binding for more details. 绑定是“绑定”到属性的 JavaScript 表达式。任何时间点的属性值都将是通过评估该表达式返回的值。有关更多详细信息,请参阅属性绑定。
Signal 信号A signal is a notification from a QML object. When an object emits a signal, other objects can receive and process this signal through a signal handler. Most properties of QML objects have a change signal, and also an associated change signal handler which may be defined by clients to implement functionality. For example, the "onClicked()" handler of an instance of the MouseArea type might be defined in an application to cause a sound to be played. See Signal and Handler Event System for more details. 信号是来自 QML 对象的通知。当一个对象发出信号时,其他对象可以通过信号处理程序接收和处理这个信号。QML 对象的大多数属性都有一个更改信号,以及一个关联的更改信号处理程序,可由客户端定义以实现功能。例如,MouseArea类型实例的“onClicked()”处理程序可能会在应用程序中定义以播放声音。有关更多详细信息,请参阅信号和处理程序事件系统。
Signal Handler 信号处理器A signal handler is the expression (or function) which is triggered by a signal. It is also known as a "slot" in C++. See Signal and Handler Event System for more details. 信号处理程序是由信号触发的表达式(或函数)。它在 C++ 中也称为“插槽”。有关更多详细信息,请参阅信号和处理程序事件系统。
Lazy Instantiation 惰性实例化Object instances can be instantiated "lazily" at run-time, to avoid performing unnecessary work until needed. Qt Quick provides the Loader type to make lazy instantiation more convenient. 对象实例可以在运行时“懒惰地”实例化,以避免在需要之前执行不必要的工作。Qt Quick 提供了Loader类型,使惰性实例化更加方便。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

道格拉斯范朋克

播种花生牛奶自留田

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值