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

*.mjs files not added to qmldir when added to qt_add_qml_module()

    XMLWordPrintable

Details

    • Linux/X11
    • bf38043b61 (qt/qtdeclarative/dev) 5d38f9641b (qt/qtdeclarative/6.2) 693b17076c (qt/qtdeclarative/6.3) 5d38f9641b (qt/tqtc-qtdeclarative/6.2) 693b17076c (qt/tqtc-qtdeclarative/6.3) bf38043b61 (qt/tqtc-qtdeclarative/dev) 5d38f9641b (qt/qtdeclarative/6.2.4)

    Description

      When adding a JavaScript module file (*.mjs) to a QML module, the file is not present in the generated qmldir file and thus cannot be imported properly.

      # CMakeLists.txt
      qt_add_qml_module(myapp
        URI MyApp
        VERSION 0.1
        RESOURCE_PREFIX /example.com/imports
        QML_FILES
          MathUtils.mjs
          SomeComponent.qml
      )
      module MyApp
      linktarget myappplugin
      optional plugin myappplugin
      classname MyAppPlugin
      typeinfo myapp.qmltypes
      prefer :/example.com/imports/MyApp/
      SomeComponent 0.0 SomeComponent.qml
      
      

      It's possible to add mjs files to qmldir, so I'd expect it to appear there:

      MathUtils 0.0 MathUtils.mjs
      

      According to this comment this should already be the case, but it doesn't work apparently.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              hlzhs Jan Holthuis
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes