Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113991

[Reg 6.4 -> 6.5] qmldir javascript library does not respect qualified import

XMLWordPrintable

    • Windows
    • 1c2ef41a8 (dev), 59b06e587 (6.6), b737337f3 (6.5)

      I have a qml module that contains a JavaScript library called Font. When I import my module with a qualified name the default QtQuick Font namespace is replaced with my Font Javascript library. This is not what I would expect.

      I am importing my module from an external url using the following syntax:

      import QtQuick
      import 'https://www.example.com/path/to/qml/module/MyModuleName' as MyModuleName
      
      // This works correctly
      MyModuleName.Font.exampleVar
      
      // This no longer exists despite the qualified import
      Font.MixedCase
      
      // This incorrectly exists
      Font.exampleVar 

      The qmldir file is structured as follows:

      module MyModuleName
      
      # qml files
      # ...
      
      # JS files
      Font 0.1 Font.js
      

      My Font.js library contains:

      .pragma library
      .import QtQuick as QtQuick
      

      And then some simple variables that I was aiming to use as constants.

        For Gerrit Dashboard: QTBUG-113991
        # Subject Branch Project Status CR V

            ulherman Ulf Hermann
            haiku Ollie Dawes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes