| 術語 | 定義 |
|---|---|
| QML | 編寫 QML 應用程序的語言。語言體係結構和引擎由 Qt QML 模塊實現。 |
| Qt Quick | QML 語言類型和功能的標準庫,由 Qt Quick 模塊提供,可以訪問采用 "import QtQuick 2.3". |
| 類型 |
在 QML,
type
可以引用
基本類型
或
QML 對象類型
.
QML 語言提供瞭許多內置 基本類型 ,和 Qt Quick 模塊提供各種 Qt Quick 類型 為構建 QML 應用程序。類型也可以由第 3 方開發者提供透過 ( 模塊 ) 或由應用程序開發者在應用程序自身透過 QML 文檔 . 見 QML 類型係統 瞭解更多細節。 |
| 基本類型 |
A
基本類型
是簡單類型,譬如
int
,
string
and
bool
。不像
對象類型
, 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 模塊 is imported. 見 QML 類型係統 瞭解更多細節。 |
| 對象類型 |
A
QML 對象類型
是可以通過 QML 引擎實例化的類型。
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. 見 QML 類型係統 瞭解更多細節。 |
| 對象 |
QML 對象是實例化的
QML 對象類型
.
Such objects are created by the engine when it processes 對象聲明 , 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(). 另請參閱 惰性實例化 . |
| 組件 |
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. 此外, 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. |
| 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. |
| 特性 |
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). 見 QML 對象屬性 瞭解更多細節。 |
| 綁定 |
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. 見 特性綁定 瞭解更多細節。 |
| 信號 |
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
信號處理程序
.
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. 見 信號和處理程序事件係統 瞭解更多細節。 |
| 信號處理程序 |
A signal handler is the expression (or function) which is triggered by a signal. It is also known as a "slot" in C++. 見 信號和處理程序事件係統 瞭解更多細節。 |
| 惰性實例化 | 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. |