Generate plugins.qmltypes files for the plugins we install
ClosedPublic

Authored by apol on Mar 17 2017, 4:51 PM.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
apol created this revision.Mar 17 2017, 4:51 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptMar 17 2017, 4:51 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein added a subscriber: hein.Mar 20 2017, 11:04 AM

Might be nice to do for p-w as well (libtaskmanager QML plugin).

I'm confused.

If you're generating the qmltypes with the ecm command, why are they in the diff?

apol added a comment.Mar 20 2017, 11:53 AM

I'm confused.

If you're generating the qmltypes with the ecm command, why are they in the diff?

Good point.
We can't generate them at runtime. Here's how they put it in Qt:

# plugins.qmltypes is used by Qt Creator for syntax highlighting and the QML code model.  It needs
# to be regenerated whenever the QML elements exported by the plugin change.  This cannot be done
# automatically at compile time because qmlplugindump does not support some QML features and it may
# not be possible when cross-compiling.

Biggest issue is that you need a set up install prefix to generate the plugins as it expects the prefix structure. Also it needs to load the plugin so it will certainly be a problem on certain setups.

We could find a workaround where it gets to be generated at build-time, but it will feel off. Here at least we're doing the same Qt does with their plugins.qmltypes files.

davidedmundson accepted this revision.Mar 24 2017, 4:19 PM
This revision is now accepted and ready to land.Mar 24 2017, 4:19 PM
apol added a comment.Mar 27 2017, 2:33 PM

Can somebody please help review the ECM side of things?
https://phabricator.kde.org/D5087

This revision was automatically updated to reflect the committed changes.

As soon as I open a qml file in a plasma project it freezes during "Loading QML imports" eating all RAM and CPU until I kill it.

apol added a comment.Apr 11 2017, 10:34 AM

As soon as I open a qml file in a plasma project it freezes during "Loading QML imports" eating all RAM and CPU until I kill it.

I'm assuming that's in QtCreator...
Can you please open a bug report there? It will be interesting to know their feedback. It's a bug on QtCreator side though, we're doing our work here, which is to document our objects.