Plugins.qmltypes: Difference between revisions
(Created page with "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...") |
No edit summary |
||
Line 1: | Line 1: | ||
This page describes the purpose of plugins.qmltypes files, and now to update them. | 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. | 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. | ||
Line 11: | Line 11: | ||
The file can be generated by the qmlplugindump command. | The file can be generated by the qmlplugindump command. | ||
== File Format == | |||
TODO | 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! | 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. | 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. |
Revision as of 08:04, 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.