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

Crash when adding JS resources to a QML document directory

    XMLWordPrintable

Details

    • All
    • 735556d19 (dev), 78ccc84dd (dev), e65451904 (6.9), 8454f7d2d (6.9), 49ee9d190 (6.8), 37f3331c7 (6.8), 5e8baedc1 (tqtc/lts-6.5), 0628ef436 (tqtc/lts-6.5)

    Description

      I have created a new project using QtCreator and selected CMake as build system. 

      Then I have added a new directory "Test" next to the already created "Main.qml", which contains the following files:

      • Hello.qml
      • qmldir

      The qmldir file I constructed according to https://doc.qt.io/qt-6/qtqml-syntax-directoryimports.html#directory-listing-qmldir-files

      It only contains the line "Bye Hello.qml".

      With this in place, I can import the directory in my "Main.qml" by using "import "Test" as T" and use "T.Bye {}" without any issues.

       

      Now, according to the above link, I should be able to also add JS resources to the directory. So I created a "test.js" file inside the "Test" dir and added a line to the qmldir file "Test test.js". The .js file contains this:

      .pragma library
      
      function Print() { console.log("Hello from Test") }
      

      In my Main.qml file, I have added this:

      ...
      import "Test" as T
      ...
      
      ApplicationWindow {
          ...
      
          Component.onCompleted: T.Test.Print()
      }
      

      When running this application via QtCreator, I only get the output: "The process crashed."

      Attachments

        1. 132118bt.txt
          5 kB
        2. qtbug-132118.tar.xz
          4 kB
        3. qtdiag.txt
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            skaldesh Sebastian Borchers
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: