blob: 9cfebf0575ba0b272fa63c309b0dee08c604feca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
/*!
\page qmlformat.html
\title QML Format Reference
\tableofcontents
\section1 Overview
QML is an extension to \l {http://www.ecma-international.org/publications/standards/Ecma-262.htm}
{ECMAScript}. QML adds a mechanism for declaratively building a tree of objects, improved
integration between ECMAScript and Qt's existing QObject based type system, and support for
transparently maintained property value bindings between ECMAScript expressions and QObject
properties.
Much of a QML file consists of valid ECMAScript \e {Statement}s. Except where constraints imposed
by ECMAScript, C++ or QObject prevented it, the syntactic extensions introduced by QML are designed
to look similar and fit well with existing ECMAScript syntax and concepts.
\section2 Commenting
The commenting rules in QML are the same as for ECMAScript. Both \e {MultiLineComment} blocks and \e {SingleLineComment}'s are supported.
\section1 Definitions
\e {QML interpreter}: QmlEngine
\e {QML execution context}: QmlContext
\e {inherited characteristic}
\section1 QML Document
\section2 Syntax
\e {QMLDocument} \bold {:}
\quotation
\e {QMLImportList} \sub {opt} \e {QMLObjectDefinition}
\endquotation
\e {QMLImportList} \bold {:}
\quotation
\e {QMLImportStatement} \e {QMLImportList} \sub {opt}
\endquotation
\e {QMLImportStatement} \bold {:}
\quotation
\bold {import} \e {StringLiteral}
\bold {import} \e {StringLiteral} \e {QMLVersionNumber}
\bold {import} \e {QMLNamespaceName} \e {QMLVersionNumber}
\bold {import} \e {StringLiteral} \bold {as} \e {QMLNamespacePrefix}
\bold {import} \e {StringLiteral} \e {QMLVersionNumber} \bold {as} \e {QMLNamespacePrefix}
\bold {import} \e {QMLNamespaceName} \e {QMLVersionNumber} \bold {as} \e {QMLNamespacePrefix}
\endquotation
\e {QMLNamespaceName} \bold {:}
\quotation
\e {QMLQualifiedId}
\endquotation
\e {QMLVersionNumber} \bold {:}
\quotation
\e {DecimalLiteral} \bold {but not} with \e {ExponentPart}
\endquotation
\section2 Semantics
A QML document is the unit in which QML code may be passed to the QML interpreter. A QML document
is syntactically self contained. QML documents are evaluated by the QML interpreter in a QML
execution context to produce a single instantiated object of the type specified by
\e {QMLObjectDefinition}.
The \e {QMLImportList} is used to statically resolve type references used within the enclosing
QML document. The import list is \bold {not} an \e {inherited characteristic}; its scope of
influence is limited to structures logically contained by the document.
An import statement is used to bring a set of types into scope for a QML document.
\section1 Object Definition
\section2 Syntax
\e {QMLObjectDefinition} \bold {:}
\quotation
\e {QMLQualifiedId} \bold {\{} \e {QMLObjectMemberList} \bold {\}}
\endquotation
\e {QMLObjectMemberList} \bold {:}
\quotation
\e {QMLObjectMember} \e {QMLObjectMemberList} \sub {opt}
\endquotation
\e {QMLObjectMember} \bold {:}
\quotation
\e {QMLMemberAssignment}
\e {QMLObjectDefinition}
\e {QMLObjectExtensionDefinition}
\endquotation
\e {QMLMemberAssignmentList} \bold {:}
\quotation
\e {QMLMemberAssignment} \e {QMLMemberAssignmentList} \sub {opt}
\endquotation
\e {QMLMemberAssignment} \bold {:}
\quotation
\e {QMLQualifiedId} \bold {:} \e {Literal} \bold {but not} \e {NullLiteral}
\e {QMLQualifiedId} \bold {:} \e {QMLObjectDefinition}
\e {QMLQualifiedId} \bold {:} \e {QMLObjectDefinitionArray}
\e {QMLQualifiedId} \bold {:} \e {QMLBindingExpression}
\e {QMLQualifiedId} \bold {\{} \e {QMLMemberAssignmentList} \bold {\}}
\endquotation
\section2 Semantics
\section1 Object Extension
\section2 Syntax
\e {QMLObjectExtensionDefinition} \bold {:}
\quotation
\e {QMLObjectPropertyDefinition}
\e {QMLObjectSignalDefinition}
\e {QMLObjectMethodDefinition}
\endquotation
\e {QMLObjectPropertyDefinition} \bold {:}
\quotation
\bold {property} \e {QmlObjectPropertyType} \e {QMLMemberIdentifier}
\bold {default} \bold {property} \e {QmlObjectPropertyType} \e {QMLMemberIdentifier}
\bold {property} \e {QmlObjectPropertyType} \e {QMLMemberIdentifier} \bold {:} \e {Literal} \bold {but not} \e {NullLiteral}
\bold {property} \e {QmlObjectPropertyType} \e {QMLMemberIdentifier} \bold {:} \e {QmlBindingExpression}
\bold {default} \bold {property} \e {QmlObjectPropertyType} \e {QMLMemberIdentifier} \bold {:} \e {Literal} \bold {but not} \e {NullLiteral}
\bold {default} \bold {property} \e {QmlObjectPropertyType} \e {QMLMemberIdentifier} \bold {:} \e {QmlBindingExpression}
\endquotation
\e {QMLObjectPropertyType} \bold {:: one of}
\quotation
\bold {int} \bold {bool} \bold {double} \bold {real} \bold {string} \bold {url} \bold {color} \bold {date} \bold {var} \bold {variant} \bold {alias}
\endquotation
\e {QMLObjectSignalDefinition} \bold {:}
\quotation
\bold {signal} \e {QMLMemberIdentifier}
\bold {signal} \e {QMLMemberIdentifier} \bold {(} QMLMemberTypedParameterList \bold {)}
\endquotation
\e {QMLObjectMethodDefinition} \bold {:}
\quotation
\e {FunctionDeclaration} \bold {but not} \e {Identifier} \sub {opt}
\endquotation
\section2 Semantics
\section1 Binding Expression
\section2 Syntax
\e {QMLBindingExpression} \bold {:}
\section2 Semantics
*/
|