Problems with Open-Source Downloads read and

QQmlExtensionPlugin : C++ constructor called but no QML component created

  • Hi,

    I'm trying to figure out how QQmlExtensionPlugin works.

    I created a plugin which derives from this class (called Button) which I import with QQmlEngine::importPlugin();
    The uri is now registered and I can instantiate it in other QML documents.

    If I do, the C++ constructor is called, but no QML component is created.

    If I understand correctly, I need to specify this in the qmldir file. But I'm confused where exactly this needs to point to. Ideally this would refer to a resource, since I would like to keep everything within the plugin.

    This is my resource file:

    <qresource prefix="/button">
    <file alias="Button">Button.qml</file>

    And this is my qmldir file

    module Button
    Button 1.0 /button/Button.qml

    but to no avail.

    Thanks for reading

Log in to reply