[Development] Toolability of mixing QML and JS

Bubke Marco Marco.Bubke at digia.com
Wed Jun 26 15:00:23 CEST 2013

Sorry for the formatting but the web email client is improvable.

Rutledge Shawn:

I see it as an issue if you had to write that parser. No wonder it's out of sync with the actual language parser. The one in declarative should have all the features that you need, with suitable (ideally even public) APIs to access > those features, it should be in the declarative module, and there should be autotests to keep it consistent. So the workflow for tooling should be that you use the declarative parser to get the AST, the tooling has the opportunity to modify the AST whenever the user does something, then you can send it on to the engine for rendering a preview, and you can also regenerate the source code by pretty-printing the AST.? That means the AST must be complete: it must include Javascript (even if they are only unmodifiable blobs) and comments, so that the pretty-printing will generate the same source code with only the changes the user wanted to make. But for optimization purposes there could be a parameter to the parser to ignore the comments, because
tooling needs them whereas the interpreter does not.
I'm not sure that you know how is works now so I believe you are not in the context. Ok, here how the designer works:

First we have a Rewriter which sits on top of the AST. It is the brigde between the our DOM like model and the AST. From the model there is a view which is
generating a qml tree in a other process. This is not the preview because we need more control for example no animations etc.. So we generate the qml object tree not from text but directly(actual there is no good interface to do it). Than we read back the values and images and compose the scene in a graphicsview, fill the values in the property editor etc.. The approach with the different process has additional advantage that a crash is not that bad, we can link with different Qt versions and can restart the process because there was a problem which we call "componentComplete lazy programming". Hope now you get a better picture. ;-)
Development mailing list
Development at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130626/64f358be/attachment.html>

More information about the Development mailing list