How to add a module with a plugin to resource file
-
Hi everyone, I am new in the forum and I have a problem to porting my application to android. I read on several topics that the main work to do is to add everything your application needs to the qrc file, so that all your dependencies will be compiled into the application executable. I am having trouble with one of my plugins. This is how my files look:
main.cpp
...
engine.addImportPath("qrc:/");
...qml.qrc
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>qmldir</file>
...qmldir file
module MyModule
MyItem 1.0 MyItem.qml
plugin MyPluginmain.qml
...
import MyModule 1.0MyItem{
}
...and this is my project directory
-MyProject
|---------- > myproject.pro
|---------- > main.cpp
|---------- > Resources
------------|----------- > qml.qrc
------------|----------- > MyModule
----------------------------|----------->qmldir
----------------------------|----------->MyItem.qml
----------------------------|----------->MyPlugin.dllThe problem is that when i run my application the build goes fine, the application loads the module but not the plugin.
qrc:/main.qml:6 module "MyModule" plugin "MyPlugin" not foundThe most wired thing is that if I change
engine.addImportPath("qrc:/");
in
engine.addImportPath("C:/path/to/my/project/Resources");
the application detects the plugin and works perfectly. Any idea to solve my problem to to help me?Thanks in advance.