diff options
-rw-r--r-- | doc/src/declarative/qmlformat.qdoc | 184 |
1 files changed, 181 insertions, 3 deletions
diff --git a/doc/src/declarative/qmlformat.qdoc b/doc/src/declarative/qmlformat.qdoc index fd22ab5..9cfebf0 100644 --- a/doc/src/declarative/qmlformat.qdoc +++ b/doc/src/declarative/qmlformat.qdoc @@ -1,6 +1,184 @@ /*! - \page qmlformat.html - \title QML Format +\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 - Format reference here... */ |