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. Plugin cannot be loaded for module
Forum Updated to NodeBB v4.3 + New Features

Plugin cannot be loaded for module

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 11.2k 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.
  • A Offline
    A Offline
    aliander
    wrote on last edited by
    #1

    Hi there!

    I created a QML Extension Plugin containing a QWidget (containing the interface down to the hardware API) through a QGraphicsProxyWidget.

    QML file looks like:

    @import QtQuick 1.0
    import "ImagerPlugin" 1.0

    Rectangle {
    width: 640
    height: 480
    ImagerWgt {
    anchors.fill: parent
    }
    }@

    Module is located at
    @./ImagerPlugin/@
    containing:

    • qmlimagerplugin.dll
    • qmldir

    qmldir:

    @plugin qmlimagerplugin@

    qmlImagerPlugin.cpp: (Containing the plugin relevant code)

    @#include <QtDeclarative/QDeclarativeExtensionPlugin>
    #include <QtDeclarative/qdeclarative.h>
    #include <QtGui/QGraphicsProxyWidget>
    #include "WgtImager.h"

    class imagerWgtProxy : public QGraphicsProxyWidget
    {
    Q_OBJECT
    public:
    explicit imagerWgtProxy(QGraphicsItem *parent = 0)
    : QGraphicsProxyWidget(parent)
    {
    imager = new WgtImager();
    imager->initCam();
    setWidget(imager);
    imager->startCam();
    }

    private:
    WgtImager *imager;

    };

    QML_DECLARE_TYPE(imagerWgtProxy);

    class imagerPlugin : public QDeclarativeExtensionPlugin
    {
    Q_OBJECT

    public:
    void registerTypes(const char *uri)
    {
    qmlRegisterType<imagerWgtProxy>(uri, 1, 0, "ImagerWgt");
    }
    };

    #include "qmlImagerPlugin.moc"
    Q_EXPORT_PLUGIN2(qmlimagerplugin,imagerPlugin);@

    Here comes the output of the SerialConsole of my WindowsMobile 6.5 Prof Emulator:

    @CertVerify: Storage CardTestImagerqmlView.exe trust = 2
    CertVerify: QtDeclaratived4.dll trust = 2
    CertVerify: QtScriptd4.dll trust = 2
    CertVerify: QtCored4.dll trust = 2
    CertVerify: msvcr90d.dll trust = 2
    CertVerify: QtSqld4.dll trust = 2
    CertVerify: QtGuid4.dll trust = 2
    CertVerify: QtNetworkd4.dll trust = 2
    CertVerify: Storage CardTestImagerimagerPluginqmlimagerplugin.dll trust = 2
    file:///Storage Card/TestImager/test.qml:2:1: plugin cannot be loaded for module
    "imagerPlugin": Cannot load library /Storage Card/TestImager/imagerPlugin/qmlim
    agerplugin.dll: The specified module could not be found.
    import "imagerPlugin" 1.0
    ^@

    QmlView.exe is just a simple QDeclarativeView
    @#include <QApplication>
    #include <QDeclarativeView>
    #include <QDeclarativeContext>
    #include <QDebug>

    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    QDeclarativeView view;
    view.setSource(QUrl::fromLocalFile("test.qml"));
    view.show();
    return app.exec();
    }
    @

    Maybe it's just a wrong naming convention I'm not getting or something...

    Any help would be appreciated ;)

    Thanks
    Ali

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      The error message looks like it is looking for a lowercase "imagerPlugin" (and path), while the code pasted above is using uppercase "ImagerPlugin". Can you verify if they are being used consistently in the code/directory naming?

      Regards,
      Michael

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aliander
        wrote on last edited by
        #3

        Thanks for the answer :)

        Was thinking about that as well... so I already tried around a bit (setting everything lowercase, etc.)
        Until now this didn't get me to a loaded module

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aliander
          wrote on last edited by
          #4

          So... I tried putting the qmldir file into the same directory as the loaded qml-File

          So I was thinking the folder structure has to look like this:
          @
          -Root
          _ qml-Files (importing "ModuleDirectory")
          _ ModuleDirectory
          _ Module-Dlls
          _ qmldir (defining modules in actual directory)
          @

          Now I changed to:
          @
          -Root
          _ qml-Files (imports)
          _ qmldir (defining module in module-directory)
          _ ModuleDirectory
          _ Module-Dlls
          @

          With the new structure the module dll seems to be loaded, but my ImagerWgt isn't recognized
          @ImagerWgt is not a type@

          Can anyone describe the correct folder structure?
          I was thinking, that both ways are possible - first one would've made more sense in my case...

          Thanks
          Ali

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aliander
            wrote on last edited by
            #5

            Hm...

            Well, I think, I made a step forward

            I changed the plugin name from imagerPlugin to QImagerPlugin

            Strangely this seems to make a difference (??)
            But maybe recompile + trial'n'error also play a role ;)

            At the moment the win mobile emulator isn't complaining, but I don't get down to to the hardware yet
            I'll change the plugin from being a qwidget to wich the camera video is streamed directly to something like a qmovie, wich accesses a QIOBlockDevice or something...

            Thanks for the moment :)

            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