Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to add a module with a plugin to resource file

How to add a module with a plugin to resource file

Scheduled Pinned Locked Moved QML and Qt Quick
modulepluginplugin windowsqmlresourceandroid
1 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lcmzt
    wrote on 2 Jul 2015, 07:45 last edited by
    #1

    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 MyPlugin

    main.qml
    ...
    import MyModule 1.0

    MyItem{
    }
    ...

    and this is my project directory
    -MyProject
    |---------- > myproject.pro
    |---------- > main.cpp
    |---------- > Resources
    ------------|----------- > qml.qrc
    ------------|----------- > MyModule
    ----------------------------|----------->qmldir
    ----------------------------|----------->MyItem.qml
    ----------------------------|----------->MyPlugin.dll

    The 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 found

    The 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.

    My code works and I don&#x27;t know why :)

    1 Reply Last reply
    0

    1/1

    2 Jul 2015, 07:45

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved