Review Request 118225: Minimal support for exported QML components

Denis Steckelmacher steckdenis at yahoo.fr
Tue May 20 17:36:59 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118225/
-----------------------------------------------------------

(Updated May 20, 2014, 5:36 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDevelop.


Repository: kdev-qmljs


Description
-------

In plugin.qmltypes files, QML components have "C++-ish" names, like "QQmlRectangle". The real QML name can be found in the "exports" property of select components. An export is a string like "QtQuick/Rectangle 1.0". Each component therefore has a namespace, a name and a version.

This patch adds support for exported component names. The namespace and the version are currently ignored, by they may be used in the future in order to tell the user that a component requires an import statement with a greater version number than provided.

Regarding the code quality, I'm not quite happy with the nested if and for loops that I had to add, but the QMLJS parser is again unable to provide a nice "ArrayEntry" node that would have made everything simpler. I'm obliged to iterate over a ElementList node and to cast its expression to a string literal.


Diffs
-----

  tests/files/plugins.qml 7544a8f 
  duchain/declarationbuilder.cpp 01ebb15 
  duchain/declarationbuilder.h aad8e2b 

Diff: https://git.reviewboard.kde.org/r/118225/diff/


Testing
-------

A test suite has been added. It ensures that a component like this:

Component {
    name: "QAbstractItemModel"
    prototype: "QObject"
    exports: ["QtQuick/AbstractItemModel 1.0"]
}

Is displayed in the outline as "QAbstractItemModel" and "AsbtractItemModel".


Thanks,

Denis Steckelmacher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140520/e383a996/attachment.html>


More information about the KDevelop-devel mailing list