Important: Please read the Qt Code of Conduct -

Using QML component in a QML file loaded from a Loader

  • Hello,

    I'm facing this problem:
    (I'm new to QML so be tolerent).

    Thanks to a "Loader" I'm including an external QML file to my project. This file is located in a remote server (far from now I use a localhost access).
    I'm including this component to my QML project lilke this:

    driverBoardElements.source = "http://localhost:3000/loadDriverBoard.qml"

    It runs well. But my loadDriverBoard.qml contains a lots of sub-components.
    On the remote access, these components are located next to the loadDriverBoard.qml file in the same directory.

    When I launch my app, I've got this error:

    http://localhost:3000/loadDriverBoard.qml:20:5: TurnSignal is not a type

    When I was running a loadDriverBoard.qml locally (on my hard drive), loaded by a Loader, with other components in the same directory than this file, all was OK.

    How can I do to load remote components in a loaded QML via a Loader ?
    Thanks a lot.

  • Moderators

    Place a qmldir file on the remote webserver. See this

  • Hi,

    Thanks a lot.

Log in to reply