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
Forum Updated to NodeBB v4.3 + New Features

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 1 Watching
  • 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.
  • LcmztL Offline
    LcmztL Offline
    Lcmzt
    wrote on 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

    • Login

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