Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-216

It's must to have a dummy qml file when creating a QML type from C++ in the module

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt for MCUs 2.5
    • Infrastructure
    • None
    • All

    Description

      I'm wondering if it's possible to create a QML type without having any qml file in the module.
      In the attached project, I have CppModule module which is defined in cppmodule.qmlproject.
       
      The issue is, when I don't have any qml files specified as QmlFiles.files in cppmodule.qmlproject, the "loader_item_allocator.cpp" doesn't get generated and the application compilation fails.

      // error. The Japanese line says "cannot open the source file"
      
      c1xx: fatal error C1083: ソース ファイルを開けません。'C:\work\MCU_Training_Material\Training_Repos\GeneralPlus\GeneralPlus\1_1_QML\07_Modules\build\qmlproject\CMakeFiles\Modules.dir\CppModule\loader_item_allocator.cpp':No such file or directory 

      But when I just created dummy.qml and set it to QmlFiles.files, the application compiled successfully. This made me wonder if I'm missing something.
      The attached project can be built with Qt for MCUs 2.5 - Desktop 32bpp (MSVC)
       

      Attachments

        1. Modules.zip
          27 kB
          Mikio Hirai
        2. image-2023-09-28-19-58-14-042.png
          1.16 MB
          Mikio Hirai
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes