Generate a qmltypes file from QML components and not C++ like qmlplugindump
-
Hi,
I have the following use-case:QtCreator allows auto-completion of C++ items from plugins, if a .qmltypes file was created for it with the qmlplugindump tool. However, what to do if I have components written in QML which I would like to distribute as a plugin?
I tried calling the qmlplugindump tool for the qml components as described in http://qt-project.org/doc/qt-4.8/qdeclarativemodules.html#writing-a-qmltypes-file, but an empty qmltypes file is the result. So it seems qmlplugindump is only applicable for C++ items. Are there other tools to generate a qmltypes file from QML files, or how could I generate the file so my components are usable from QtCreator?
Cheers,
Chris -
IIRC creator will just parse .qml files that the user imports. No dumping should be necessary.
-
Hi Tobias,
QtCreator can resolve the component definition when the qml sources are available that's right - however, I would like to distribute the plugin without the source code of the qml files. Thus I would like to generate qmltypes files from the qml sources.
Thanks,
Chris -
I am not really good with QML, sorry, but I would be surprised if that is possible.
The QML files are evaluated at runtime to do whatever they do. If you remove those files, then the functionality is gone.
-
Any more word on this? The documentation indicates that it should work with just QML files, but it doesn't seem to be working for me either.
-
Yes I only have qml files in my qml plugin.
I'm not sure how it works, but I build a qml plugin with only qml files (styled controls) and deployed that plugin in the Qt5.3 install tree.
Then this command dropped me the correct plugins.qmltypes to enable color completion in qtcreator.Have a look at qtquick.controls module sources, in their qmltypes files i noted the command that generated the file.