Plugins.qmltypes: Difference between revisions
No edit summary |
No edit summary |
||
Line 20: | Line 20: | ||
Note that not all modules do work fine with qmlplugindump; In particular, crashes on exit are often seen. This does not imply though that the output is invalid. | Note that not all modules do work fine with qmlplugindump; In particular, crashes on exit are often seen. This does not imply though that the output is invalid. | ||
For running the command on a whole subtree (for instance inside qtdeclarative/imports), go to the build dir of qtdeclarative and execute e.g. | |||
for path in `find . -name Makefile -print`; do pushd `dirname $path`; make qmltypes; popd; done |
Revision as of 09:27, 30 August 2018
This page describes the purpose of plugins.qmltypes files, and now to update them.
Purpose
plugins.qmltypes files are used to describe the API a QML Module defines as QML metadata. It's main consumer is Qt Creator, which uses it for code completion and underlining errors etc.
Qt Creator looks for the file alongside the module itself. The qmldir file of the module can link to it with 'typeinfo <filepath>'. Although the name is actually free, the default is plugins.qmltypes, and giving it a different name just causes confusion.
Aside from the use in tooling, it is also a good place to do QML API reviews!
The file can be generated by the qmlplugindump command.
File Format
TODO
Updating plugins.qmltypes
qmake generates a 'qmltypes' target, that you can run. The platform shouldn't matter, as long as it is possible to load the QML import there!
Note that not all modules do work fine with qmlplugindump; In particular, crashes on exit are often seen. This does not imply though that the output is invalid.
For running the command on a whole subtree (for instance inside qtdeclarative/imports), go to the build dir of qtdeclarative and execute e.g.
for path in `find . -name Makefile -print`; do pushd `dirname $path`; make qmltypes; popd; done