Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Module location transparency, flawed ?

    QML and Qt Quick
    2
    3
    1373
    Loading More Posts
    • 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
      Tipiak last edited by

      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 Reply Quote 0
      • T
        Tipiak last edited by

        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 Reply Quote 0
        • T
          tobias.hunger last edited by

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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post