[Interest] Errors trying to import an external QML module to my project

Daniel Fran├ža daniel.franca at gmail.com
Wed Sep 2 10:03:53 CEST 2015


Hi guys

I'm trying to import the modules from papyros
<http://papyros.io/developer/index.html> (awesome components btw) to my
application. For that I cloned the repo, and then I added the modules path
to the *QML2_IMPORT_PATH* env var.

The papyros is already with the qmldir files set correctly, so all I'd to
do is to add the dirs to the QML2_IMPORT_PATH

i.e: If the qmldir is inside */myhome/qml-material/modules/Material* dir,
then I added the */myhome/qml-material/modules/Material* to the
QML2_IMPORT_PATH var.

I also tried to add using:

engine.addImportPath("/myhome/qml-material/modules/Material");

in the main.cpp just before load the main qml file.

Nothing seems to be working, I can't import the components inside my app
and the Qt Creator code completion completely ignore the new dirs. I tried
to add it in several different ways:

import modules.Material.Action 0.1import Material.Action 0.1import Action 0.1

But I keep receiving the error: *module "Module name" is not installed*

The only way it works is using the full path:

import "/myhome/qml-material/modules/Material/Action.qml" as Action

But, of course, it's not what I want to.

Any idea how can I solve that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150902/dd1b814b/attachment.html>


More information about the Interest mailing list