api: Support assigning qualified qmlelem to a property - #18
Conversation
beb600d to
da3ec0d
Compare
| [ | ||
| "qmlelem", | ||
| "Item", | ||
| "QQ.Item", |
There was a problem hiding this comment.
This is not the proper format for qmlelem. See ImportsNamed.qml.json#L27-L32 for how qualified qmlelem should be encoded. You could also test with longer paths. e.g. Abc.Def.Rectangle.
| property var foo: {} | ||
| property var bar: [] | ||
| property Item item: Item {} | ||
| property Item item: QQ.Item {} |
There was a problem hiding this comment.
This should be added as a new line, and should not replace the current property Item item: Item {} test.
| import QtQuick 2.5 as QQ | ||
|
|
||
| Rectangle { | ||
| QQ.Rectangle { |
| @@ -1,6 +1,6 @@ | |||
| import QtQuick 2.5 | |||
| import QtQuick 2.5 as QQ | |||
There was a problem hiding this comment.
The original line should be present to keep the existing testcase (see comment below).
Perhaps use some other import, not QtQuick, and add it to the second line?
| [ | ||
| "qmlelem", | ||
| "Rectangle", | ||
| "QQ.Rectangle", |
There was a problem hiding this comment.
This has changed and will be ["dot", "QQ", "Rectangle"], after a rebase.
Note that this line shouldn't even be present here, as Rectangle → QQ.Rectangle is an unrelated change on this line.
|
@stephenmdangelo, sorry for not reviewing at this earlier. In general, I'm in favor of this PR (and thanks for doing this!), but it requires some changes before landing. See the review above. |
6558d26 to
dee5696
Compare
|
@ChALkeR So I've cleaned up the Properties.json test (as well, I added a change to I think I'm generating the dot expression as you're suggesting. Though I find it odd that the But a non-assigned So I went with the latter form. Is this correct? If so, why don't we use the |
| for (const file of fs.readdirSync(dir)) { | ||
| const filePath = path.join(dir, file); | ||
| if (file[0] === ".") { | ||
| continue; |
There was a problem hiding this comment.
Nit: should be above const filePath.
|
I will take a look at |
dee5696 to
673e84f
Compare
e.g.
import QtQuick 2.5 as QQ
Repeater {
delegate: QQ.Rectangle {}
}
PR-URL: qmlweb#18
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Some editors (i.e. vi) may put temporary files into the tests directory. Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
673e84f to
83b9686
Compare
e.g.
import QtQuick 2.5 as QQ
Repeater {
delegate: QQ.Rectangle {}
}