Review Request 118560: Recognize object bindings in QML files

Denis Steckelmacher steckdenis at yahoo.fr
Thu Jun 5 11:11:38 UTC 2014


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

(Updated June 5, 2014, 11:11 a.m.)


Review request for KDevelop.


Changes
-------

Upload the diff. Strange, ReviewBoard should have warned me that something went wrong and that there was no diff.


Repository: kdev-qmljs


Description
-------

Object bindings are objects bound to QML properties, and modifying them. The most used object binding is "Behavior on ... { }". This patch adds support for these object bindings, and recognize them as instances of QML components. In my previous example, a new subclass of Behavior is declared and can have its own properties, id, etc.

The patch is quite simple and handles object bindings the same way as component subclasses were already handled. "Behavior on foo { ... }" is therefore handled exactly as if the user had typed "Behavior { ... }".


Diffs (updated)
-----

  duchain/declarationbuilder.h 908cdcf 
  duchain/declarationbuilder.cpp 3e885ad 
  tests/files/test.qml 8e06867 

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


Testing
-------

A new unit test ensures that object bindings are properly recognized and act like normal component instantiations.

Behavior on foo {
    id: behavior    // This is an instance named "behavior" of an anonymous class inheriting from Behavior
}


Thanks,

Denis Steckelmacher

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


More information about the KDevelop-devel mailing list