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. Using QML component in a QML file loaded from a Loader
QtWS25 Last Chance

Using QML component in a QML file loaded from a Loader

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 786 Views
  • 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.
  • S Offline
    S Offline
    stalex
    wrote on last edited by
    #1

    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.

    raven-worxR 1 Reply Last reply
    0
    • S stalex

      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.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @stalex
      Place a qmldir file on the remote webserver. See this

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3
      • S Offline
        S Offline
        stalex
        wrote on last edited by
        #3

        Hi,

        Thanks a lot.

        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