<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/src/qml/parser/qqmljs.g, branch wip/iosstyle</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>QML: Take care of QVariant when converting function arguments</title>
<updated>2022-02-23T11:09:42+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2022-02-22T12:40:09+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=c8e756e560ce3f0d369df65986e5578e0e963c66'/>
<id>c8e756e560ce3f0d369df65986e5578e0e963c66</id>
<content type='text'>
We cannot convert to QVariant using QMetaType::convert(). But we can
just construct a QVariant with the desired type and data. This will
become an issue once we automatically convert argument types to match
the desired type inside the function.

As a side effect, also allow declaring "var" arguments to functions.

Change-Id: Idc14021d8d85d3d09ee7b7f286de91b56ea02bfd
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We cannot convert to QVariant using QMetaType::convert(). But we can
just construct a QVariant with the desired type and data. This will
become an issue once we automatically convert argument types to match
the desired type inside the function.

As a side effect, also allow declaring "var" arguments to functions.

Change-Id: Idc14021d8d85d3d09ee7b7f286de91b56ea02bfd
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QML: Allow declaring and binding list&lt;foo&gt; properties in one step</title>
<updated>2022-01-31T12:41:39+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2022-01-21T13:39:48+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e7db279c2854856c819a970391b3566c730b68f7'/>
<id>e7db279c2854856c819a970391b3566c730b68f7</id>
<content type='text'>
We apply the same trick we already use for the UiObjectMember rules: We
add an ExpressionStatementLookahead before the T_LBRACKET starting the
UiArrayMemberList.

Task-number: QTBUG-82443
Change-Id: Ibdb3111b7721d2af087c14b79538dee131b8e301
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We apply the same trick we already use for the UiObjectMember rules: We
add an ExpressionStatementLookahead before the T_LBRACKET starting the
UiArrayMemberList.

Task-number: QTBUG-82443
Change-Id: Ibdb3111b7721d2af087c14b79538dee131b8e301
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>QmlCompiler: Fix return type calculation</title>
<updated>2021-12-06T18:35:50+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2021-12-01T18:05:51+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=1003626e6ac98bc2a1eb0d2ed5df8727612f37ae'/>
<id>1003626e6ac98bc2a1eb0d2ed5df8727612f37ae</id>
<content type='text'>
We can return void from a function, explicitly or implicitly, and we
need to be able to wrap that into a QVariant. In order to explicitly
return void, we need the void type to be exposed and understood.

Pick-to: 6.2
Change-Id: I513cabb25469b89a85b5d212a6825a037400729d
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We can return void from a function, explicitly or implicitly, and we
need to be able to wrap that into a QVariant. In order to explicitly
return void, we need the void type to be exposed and understood.

Pick-to: 6.2
Change-Id: I513cabb25469b89a85b5d212a6825a037400729d
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up property attributes (2/2)</title>
<updated>2021-11-17T19:59:23+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2021-11-15T15:16:16+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=c9380aa42805cf55736dc87c87149d912282c0ae'/>
<id>c9380aa42805cf55736dc87c87149d912282c0ae</id>
<content type='text'>
This commit introduces a new AST node for property attributes (currently
required, default and readonly). That node is not integrated into our
visitors, as it is only meant as an internal implementaion detail of
UiPublicMember. All information stored in it is meant to be accessed by
UiPublicMember's methods (see also the note below).
We use an union of SourceLocation and a node pointer to only pay the
overhead of the new node for properties; signals simply store the signal
token.

The grammar is rewritten with a new UiPropertyAttributes rule, which
avoids quite a bit of duplication in various rules, which had to deal
with the combinatorial explosion of attributes. Some parse errors are
now turned into semantic errors instead (readonly without initializer,
required with initializer).

By centralizing the handling of attributes in the grammar, we now can
easily support e.g. default properties with a list initializer.

As part of this restructuring, UiPublicMember's firstSourceLocation is
fixed to ensure that we actually return the first source location,
independent of the order in which the attributes are written.

Note: In theory, we would not need to make UiPropertyAttributes an AST
node. It could be a simple data class. However, the parser currently
assumes that every pointer in its parser stack is an AST node, and
touching that part would be a larger undertaking. As we use a pool
allocator, the cost is not that high (though we use more memory from the
pool then we would strictly need to).

Change-Id: Ia1d9fd7a6553d443cc57bc3d773f5be0aebe0e0e
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit introduces a new AST node for property attributes (currently
required, default and readonly). That node is not integrated into our
visitors, as it is only meant as an internal implementaion detail of
UiPublicMember. All information stored in it is meant to be accessed by
UiPublicMember's methods (see also the note below).
We use an union of SourceLocation and a node pointer to only pay the
overhead of the new node for properties; signals simply store the signal
token.

The grammar is rewritten with a new UiPropertyAttributes rule, which
avoids quite a bit of duplication in various rules, which had to deal
with the combinatorial explosion of attributes. Some parse errors are
now turned into semantic errors instead (readonly without initializer,
required with initializer).

By centralizing the handling of attributes in the grammar, we now can
easily support e.g. default properties with a list initializer.

As part of this restructuring, UiPublicMember's firstSourceLocation is
fixed to ensure that we actually return the first source location,
independent of the order in which the attributes are written.

Note: In theory, we would not need to make UiPropertyAttributes an AST
node. It could be a simple data class. However, the parser currently
assumes that every pointer in its parser stack is an AST node, and
touching that part would be a larger undertaking. As we use a pool
allocator, the cost is not that high (though we use more memory from the
pool then we would strictly need to).

Change-Id: Ia1d9fd7a6553d443cc57bc3d773f5be0aebe0e0e
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Clean up property attributes (1/2)</title>
<updated>2021-11-17T19:59:23+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2021-11-15T10:45:14+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=f9bddfa12d233d9ef01299869f4d491d62a0828e'/>
<id>f9bddfa12d233d9ef01299869f4d491d62a0828e</id>
<content type='text'>
Instead of directly accessing the attribute related members of
UiPublicMember, we access them via a function.
Moreover, we remove some redundancy: A property is
readonly/default/required if and only if the corresponding token is
valid. Thus we can drop the boolean members.

Change-Id: I22f15b2b037e857d2f9d3167cb761cba9516a135
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of directly accessing the attribute related members of
UiPublicMember, we access them via a function.
Moreover, we remove some redundancy: A property is
readonly/default/required if and only if the corresponding token is
valid. Thus we can drop the boolean members.

Change-Id: I22f15b2b037e857d2f9d3167cb761cba9516a135
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
Reviewed-by: Ulf Hermann &lt;ulf.hermann@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>qqmljs.g: always set operatorToken</title>
<updated>2021-11-04T12:35:48+00:00</updated>
<author>
<name>Fawzi Mohamed</name>
<email>fawzi@gmx.ch</email>
</author>
<published>2021-11-03T14:30:42+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e89d85847b7d70e8e5e66979851f640b13bcf820'/>
<id>e89d85847b7d70e8e5e66979851f640b13bcf820</id>
<content type='text'>
operatorToken was not set in all cases for assignments

Change-Id: I0c2a3aba022034ed9b3c8021433b71b3df4b3ccf
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
operatorToken was not set in all cases for assignments

Change-Id: I0c2a3aba022034ed9b3c8021433b71b3df4b3ccf
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a Pragma for list assign behavior</title>
<updated>2021-10-13T12:03:41+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2021-10-11T11:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=f2a15482ddd289a36b04316a2b6ebed83eb017c5'/>
<id>f2a15482ddd289a36b04316a2b6ebed83eb017c5</id>
<content type='text'>
[ChangeLog][QtQml] You can now specify the list property assignment
behavior in QML using the "ListPropertyAssignBehavior" pragma. This is
analogous to the macros you can use in C++.

Fixes: QTBUG-93642
Change-Id: I9bdcf198031f1e24891f947b0990a3253d29a998
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ChangeLog][QtQml] You can now specify the list property assignment
behavior in QML using the "ListPropertyAssignBehavior" pragma. This is
analogous to the macros you can use in C++.

Fixes: QTBUG-93642
Change-Id: I9bdcf198031f1e24891f947b0990a3253d29a998
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fix handling of arrow functions</title>
<updated>2021-09-17T14:43:22+00:00</updated>
<author>
<name>Fawzi Mohamed</name>
<email>fawzi@gmx.ch</email>
</author>
<published>2021-09-14T14:22:57+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=1d439e0abe07d232b24cdde6166b20eff4070bc6'/>
<id>1d439e0abe07d232b24cdde6166b20eff4070bc6</id>
<content type='text'>
* correctly set lbraceToken in all cases (there was a wrong index in
the grammar)
* avoid semicolon for "virtual" return statements of arrow functions

Change-Id: I2966558c835fdc74ecfb4d31e001a22dda385912
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* correctly set lbraceToken in all cases (there was a wrong index in
the grammar)
* avoid semicolon for "virtual" return statements of arrow functions

Change-Id: I2966558c835fdc74ecfb4d31e001a22dda385912
Reviewed-by: Fabian Kosmale &lt;fabian.kosmale@qt.io&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Treat substitution free template string literals as string bindings</title>
<updated>2021-07-23T14:34:55+00:00</updated>
<author>
<name>Fabian Kosmale</name>
<email>fabian.kosmale@qt.io</email>
</author>
<published>2021-07-23T11:11:01+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e8121d93003f621a6d91e32c1539945a0779745a'/>
<id>e8121d93003f621a6d91e32c1539945a0779745a</id>
<content type='text'>
Before this change, they were treated as script bindings, which are less
efficient, and could not be used in ListElement.

Fixes: QTBUG-95139
Pick-to: 6.2
Change-Id: Ic66052c7f58b3ffdf1b7c0c169f42b4f99df62a1
Reviewed-by: Maximilian Goldstein &lt;max.goldstein@qt.io&gt;
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this change, they were treated as script bindings, which are less
efficient, and could not be used in ListElement.

Fixes: QTBUG-95139
Pick-to: 6.2
Change-Id: Ic66052c7f58b3ffdf1b7c0c169f42b4f99df62a1
Reviewed-by: Maximilian Goldstein &lt;max.goldstein@qt.io&gt;
Reviewed-by: Andrei Golubev &lt;andrei.golubev@qt.io&gt;
Reviewed-by: Qt CI Bot &lt;qt_ci_bot@qt-project.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Evaluate type assertions in QML</title>
<updated>2021-05-26T12:46:39+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@qt.io</email>
</author>
<published>2021-05-20T12:09:08+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=0472a7a4326cf9ac1abdcbc0910c3b13f5c4fb5a'/>
<id>0472a7a4326cf9ac1abdcbc0910c3b13f5c4fb5a</id>
<content type='text'>
Type assertions actually check whether the expression matches the type,
and return null if it doesn't.

[ChangeLog][QtQml] You can use TypeScript-like type assertions using
"as" now. In contrast to TypeScript, QML's type assertions are enforced
at runtime. If the type doesn't match, null is returned for object
types. Also, type assertions can only cast to object types. There is no
way to create a value type or primitive type reference. As value types
and primitives cannot be polymorphic, this doesn't matter, though.
There are other ways of converting those.

Task-number: QTBUG-93662
Change-Id: I00fce3d4ea7a8c6b4631c580eaf6c113ac485813
Reviewed-by: Cristian Maureira-Fredes &lt;cristian.maureira-fredes@qt.io&gt;
Reviewed-by: Paul Wicking &lt;paul.wicking@qt.io&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Type assertions actually check whether the expression matches the type,
and return null if it doesn't.

[ChangeLog][QtQml] You can use TypeScript-like type assertions using
"as" now. In contrast to TypeScript, QML's type assertions are enforced
at runtime. If the type doesn't match, null is returned for object
types. Also, type assertions can only cast to object types. There is no
way to create a value type or primitive type reference. As value types
and primitives cannot be polymorphic, this doesn't matter, though.
There are other ways of converting those.

Task-number: QTBUG-93662
Change-Id: I00fce3d4ea7a8c6b4631c580eaf6c113ac485813
Reviewed-by: Cristian Maureira-Fredes &lt;cristian.maureira-fredes@qt.io&gt;
Reviewed-by: Paul Wicking &lt;paul.wicking@qt.io&gt;
</pre>
</div>
</content>
</entry>
</feed>
