Review Request 118215: Declare QML components and component instances in the top-level context of their document
Denis Steckelmacher
steckdenis at yahoo.fr
Tue May 20 11:33:37 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118215/
-----------------------------------------------------------
Review request for KDevelop.
Repository: kdev-qmljs
Description
-------
In QML, component instances (identified by an "id" property) are globally visible and can even be used before they are declared. This patch ensures that QML component instances are declared in the top-level context of their document, but does not address the problem of components used before they are declared.
QML components themselves must also be declared in the top-level context of their module. For instance, a Rectangle component declared like this:
Module {
Component {
name: "Rectangle"
}
}
Must be declared as "Rectangle", and not "Module::Rectangle" as is the case without this patch. Having Rectangle declared in the top-level context will allow import statements to work as expected (if you import a module, you expect Rectangle to be available, not Module.Rectangle).
Diffs
-----
duchain/declarationbuilder.cpp a0a34af
duchain/tests/testdeclarations.cpp 476c673
Diff: https://git.reviewboard.kde.org/r/118215/diff/
Testing
-------
Two C++ unit tests have been changed, because every QML component instance is now declared in the top-level context (and not only the top-level component). All the other unit tests pass unchanged.
Thanks,
Denis Steckelmacher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140520/5ee1ef2f/attachment.html>
More information about the KDevelop-devel
mailing list