[Qbs] Application with QML_ELEMENT in library, problem with plugins.qmltypes

Stéphane Fabry sf at xris.eu
Tue May 14 09:17:47 CEST 2024


Hi,

Here is a small example project with a QtQuick app and a C++ library.

Both are separate Product in the qbs Project, both define a class
declared with QML_ELEMENT and are imported into the Main.qml
The Qml import is declared with:

    Qt.qml.importName: "People"

    Qt.qml.importVersion: "1.0"

The projet is running fine, the problem lies in the QtCreator loading
the qmltypes.

It loads correctly the "app.qmltypes" located next to the app.exe but
it won't load the library "plugins.qmltypes" located next to the dll.

Did I miss something ?

I'm very close to heaven, does someone has an idea how to solve this ?

Thanks

----

Main.qml

----

import QtQuick

import People 1.0

import Cars 1.0

Window {

    width: 640

    height: 480

    visible: true

    title: qsTr("Hello World")

    Person {

        id: bob

        name: "Bob Jones"

        shoeSize: 12

    }

    Lotus {

        id: car

        name: "emira"

        mainColor: "blue"

    }

    Text {

        anchors.centerIn: parent

        text: bob.name + " drives " + car.name

    }

}

STÉPHANE FABRY , C.O.O. & Software Manager 

T: +32 4 367 07 92 [tel:+3243670792]

_X-Ray Imaging Solutions_ | www.xris.eu [http://www.xris.eu/]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20240514/82b7ca39/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestQmlElement.zip
Type: application/x-zip-compressed
Size: 3109 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20240514/82b7ca39/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 32820 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20240514/82b7ca39/attachment-0001.png>


More information about the Qbs mailing list