Review Request 117886: Recognize components, properties, signals, slots and methods in plugin.qmltypes files

Denis Steckelmacher steckdenis at
Wed Apr 30 17:33:41 UTC 2014

This is an automatically generated e-mail. To reply, visit:

(Updated April 30, 2014, 5:33 p.m.)

Review request for KDevelop.


Document the difference between typeFromName and typeFromClassName, handle QML classes having no base classes, and QML methods return void by default.

Repository: kdev-qmljs


Sorry for the size of this patch, but most of the things added in this patch are needed in order for it to be unit-testable. This patch adds the following:

* A method that takes a QML type name ("int", "float", "bool" or any class name like "QObject") and returns the corresponding IntegralType, StructureType or DelayedType
* Support for plugin.qmltypes files that declare QML components and their properties, methods, signals and slots (methods, signals and slots have their argument types recognized)
* A new test file

This screenshot ( shows what KDevelop displays when I put my cursor on "Component". The component is correctly declared (using its name and its prototype), and its use is correctly detected (though this detection will come in a future patch). "Component" is highlighted instead of "name: "QAbstractItemModel"" because highlighting string literals was not pretty at all.

A future patch will add support for enumerations, then I will need to figure out how to correctly put all these declarations in the correct namespaces (each component comes with the domain name of the package in which it has to be registered).

Diffs (updated)

  duchain/declarationbuilder.cpp 9fc2e6c 
  duchain/declarationbuilder.cpp.orig PRE-CREATION 
  duchain/declarationbuilder.h 2f7affc 
  duchain/declarationbuilder.h.orig PRE-CREATION 
  tests/files/plugins.qml PRE-CREATION 



I've added a testsuite for this patch, and it passes, even though it is quite minimal because there are still many things to do :-) .


Denis Steckelmacher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the KDevelop-devel mailing list