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. Module location transparency, flawed ?
Forum Update on Monday, May 27th 2025

Module location transparency, flawed ?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.6k 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.
  • T Offline
    T Offline
    Tipiak
    wrote on 16 Mar 2011, 18:33 last edited by
    #1

    I've got the following files hierarchy somewhere:
    @
    mysdk/
    ---mywidgets/
    ---widget1.qml
    ---widget2.qml
    ---qmldir
    ---tools/
    ---myLoader.qml
    ---qmldir
    @

    and in myLoader.qml, i've got the following code

    @
    import Qt 4.7

    Item {
    ...
    property alias loadComponent: loader.sourceComponent
    Loader {
    id: loader
    }
    }
    @

    I set the QT_MPORT_PATH and when I try something like this:

    @
    import Qt 4.7
    import mysdk.mywidgets 1.0
    import mysdk.tools 1.0

    item {
    MyLoader {
    loadComponent: Widget1
    }
    }
    @

    It does not work! the Widget1 is not resolved. The only solution is to use a "../widget1.qml" kind of url and that's exactly what i do not want.

    Is there a way to do this or is this limitation is wanted/known/featured ?--

    .signature

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tipiak
      wrote on 17 Mar 2011, 16:10 last edited by
      #2

      bump?

      i tried:

      @
      import Qt 4.7
      import mysdk.mywidgets 1.0 as MyW
      import mysdk.tools 1.0

      item {
      MyLoader {
      loadComponent: MyW.Widget1
      }
      }
      @

      but it's the same problem :/

      .signature

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on 17 Mar 2011, 18:40 last edited by
        #3

        Try uppercase for the first letter of your component. QML is case sensitive, even wrt. filenames used.

        1 Reply Last reply
        0

        1/3

        16 Mar 2011, 18:33

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved