Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How can I tell if my qml files are actually compiled in to my app?
Forum Updated to NodeBB v4.3 + New Features

How can I tell if my qml files are actually compiled in to my app?

Scheduled Pinned Locked Moved Solved Qt 6
4 Posts 2 Posters 814 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    Rich v
    wrote on last edited by
    #1

    I suspect my qml files specified in the CMakeLists.txt for the app itself (not a separate qml module) are not getting into the qrc system. I've been converting Qt5-based code to work with Qt6 and in the process of converting from the old

    qtquick_compiler_add_resources(RESOURCES myqrc.qrc)
    

    to the equivalent

    qt_add_qml_module()
    

    call. However, while the previous method worked fine and the files ended up in the appropriate qrc:/qml/myFile.qml area, I have qml codegen errors when compiling the same files. Those files compile just fine with Qt5's CMake API.

    I suspect that the codegen errors prevent inclusion of the compiled output in the qrc system.

    Here's a sample of those errors:

    [1482/1513 55.2/sec] Generating .rcc/qmlcache/PerMain_qml/main_qml.cpp
    qml.compiler.cppcodegen: main.qml:24: Could not compile signal handler for activeFocusItemChanged: The signal does not exist
    qml.compiler.cppcodegen: main.qml:102: Could not compile function createAlwaysOnTopComponents: Cannot access value for name BCFunctional
    qml.compiler.cppcodegen: main.qml:111: Could not compile function showMaterialDialog: Cannot access value for name BCFunctional
    qml.compiler.cppcodegen: main.qml:120: Could not compile signal handler for closing: The signal does not exist
    qml.compiler.cppcodegen: main.qml:139: Could not compile function componentCompleted: Cannot access value for name BQFeatures
    qml.compiler.cppcodegen: main.qml:149: Could not compile binding for changePrinterLanguage: Cannot access value for name BQDisplayPreferences
    qml.compiler.cppcodegen: main.qml:152: Could not compile binding for onChangePrinterLanguageChanged: Cannot access value for name BQLanguageSupport
    qml.compiler.cppcodegen: main.qml:38: Could not compile binding for rotation: Cannot access value for name BCDisplayHelper
    qml.compiler.cppcodegen: main.qml:49: Could not compile binding for width: The property does not exist
    qml.compiler.cppcodegen: main.qml:51: Could not compile signal handler for buttonPressed: The signal does not exist
    qml.compiler.cppcodegen: main.qml:52: Could not compile signal handler for jumpToAppWithArgs: The signal does not exist
    qml.compiler.cppcodegen: main.qml:50: Could not compile binding for top: The property does not exist
    qml.compiler.cppcodegen: main.qml:59: Could not compile binding for height: The property does not exist
    qml.compiler.cppcodegen: main.qml:60: Could not compile binding for width: The property does not exist
    qml.compiler.cppcodegen: main.qml:62: Could not compile signal handler for displayMaterialDialog: The signal does not exist
    qml.compiler.cppcodegen: main.qml:63: Could not compile signal handler for jumpToAppWithArgs: The signal does not exist
    qml.compiler.cppcodegen: main.qml:58: Could not compile binding for bottom: The property does not exist
    qml.compiler.cppcodegen: main.qml:69: Could not compile binding for top: The property does not exist
    qml.compiler.cppcodegen: main.qml:70: Could not compile binding for bottom: The property does not exist
    qml.compiler.cppcodegen: main.qml:71: Could not compile binding for left: The property does not exist
    qml.compiler.cppcodegen: main.qml:72: Could not compile binding for right: The property does not exist
    qml.compiler.cppcodegen: main.qml:79: Could not compile binding for visible: The property does not exist
    qml.compiler.cppcodegen: main.qml:84: Could not compile binding for visible: The property does not exist
    

    Am I correct that these compile problems are preventing the various qml files from being accessible at runtime from the expected qrc:/MyApp/main.qml location? If so, why am I running into all these errors when the compile just fine with qtquick_compiler_add_resources()?

    raven-worxR 1 Reply Last reply
    0
    • R Rich v

      I suspect my qml files specified in the CMakeLists.txt for the app itself (not a separate qml module) are not getting into the qrc system. I've been converting Qt5-based code to work with Qt6 and in the process of converting from the old

      qtquick_compiler_add_resources(RESOURCES myqrc.qrc)
      

      to the equivalent

      qt_add_qml_module()
      

      call. However, while the previous method worked fine and the files ended up in the appropriate qrc:/qml/myFile.qml area, I have qml codegen errors when compiling the same files. Those files compile just fine with Qt5's CMake API.

      I suspect that the codegen errors prevent inclusion of the compiled output in the qrc system.

      Here's a sample of those errors:

      [1482/1513 55.2/sec] Generating .rcc/qmlcache/PerMain_qml/main_qml.cpp
      qml.compiler.cppcodegen: main.qml:24: Could not compile signal handler for activeFocusItemChanged: The signal does not exist
      qml.compiler.cppcodegen: main.qml:102: Could not compile function createAlwaysOnTopComponents: Cannot access value for name BCFunctional
      qml.compiler.cppcodegen: main.qml:111: Could not compile function showMaterialDialog: Cannot access value for name BCFunctional
      qml.compiler.cppcodegen: main.qml:120: Could not compile signal handler for closing: The signal does not exist
      qml.compiler.cppcodegen: main.qml:139: Could not compile function componentCompleted: Cannot access value for name BQFeatures
      qml.compiler.cppcodegen: main.qml:149: Could not compile binding for changePrinterLanguage: Cannot access value for name BQDisplayPreferences
      qml.compiler.cppcodegen: main.qml:152: Could not compile binding for onChangePrinterLanguageChanged: Cannot access value for name BQLanguageSupport
      qml.compiler.cppcodegen: main.qml:38: Could not compile binding for rotation: Cannot access value for name BCDisplayHelper
      qml.compiler.cppcodegen: main.qml:49: Could not compile binding for width: The property does not exist
      qml.compiler.cppcodegen: main.qml:51: Could not compile signal handler for buttonPressed: The signal does not exist
      qml.compiler.cppcodegen: main.qml:52: Could not compile signal handler for jumpToAppWithArgs: The signal does not exist
      qml.compiler.cppcodegen: main.qml:50: Could not compile binding for top: The property does not exist
      qml.compiler.cppcodegen: main.qml:59: Could not compile binding for height: The property does not exist
      qml.compiler.cppcodegen: main.qml:60: Could not compile binding for width: The property does not exist
      qml.compiler.cppcodegen: main.qml:62: Could not compile signal handler for displayMaterialDialog: The signal does not exist
      qml.compiler.cppcodegen: main.qml:63: Could not compile signal handler for jumpToAppWithArgs: The signal does not exist
      qml.compiler.cppcodegen: main.qml:58: Could not compile binding for bottom: The property does not exist
      qml.compiler.cppcodegen: main.qml:69: Could not compile binding for top: The property does not exist
      qml.compiler.cppcodegen: main.qml:70: Could not compile binding for bottom: The property does not exist
      qml.compiler.cppcodegen: main.qml:71: Could not compile binding for left: The property does not exist
      qml.compiler.cppcodegen: main.qml:72: Could not compile binding for right: The property does not exist
      qml.compiler.cppcodegen: main.qml:79: Could not compile binding for visible: The property does not exist
      qml.compiler.cppcodegen: main.qml:84: Could not compile binding for visible: The property does not exist
      

      Am I correct that these compile problems are preventing the various qml files from being accessible at runtime from the expected qrc:/MyApp/main.qml location? If so, why am I running into all these errors when the compile just fine with qtquick_compiler_add_resources()?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Rich-v said in How can I tell if my qml files are actually compiled in to my app?:

      to the equivalent
      qt_add_qml_module()

      since you said you are not building a module this is not the equivalent method

      you might rather want this: https://doc.qt.io/qt-6/resources.html#build-system-integration

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      R 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @Rich-v said in How can I tell if my qml files are actually compiled in to my app?:

        to the equivalent
        qt_add_qml_module()

        since you said you are not building a module this is not the equivalent method

        you might rather want this: https://doc.qt.io/qt-6/resources.html#build-system-integration

        R Offline
        R Offline
        Rich v
        wrote on last edited by Rich v
        #3

        @raven-worx
        The blog here [1] seemed to indicate that the main program was a module just as the "extra module" was a module. I'm just trying to offer justification for trying what I did. Here's what that blog prescribed:

        qt_add_executable(main_program main.cpp)
        
        qt_add_qml_module(main_program
            VERSION 1.0
            URI myProject
            QML_FILES
                main.qml
            SOURCES
                onething.cpp onething.h
        )
        

        It's also mentioned on the page you linked that qt_add_qml_module is an option:

        Finally, qt_add_qml_module allows you to embed Qt Quick resources into the resource system of your application. The function is defined in the Qml component of the Qt6 CMake package.
        

        I don't fully understand if the options listed at the URL you provided are all created equal or if there are only certain circumstances when you should use qt_add_qml_module.

        [1] https://www.qt.io/blog/qml-modules-in-qt-6.2

        1 Reply Last reply
        0
        • R Offline
          R Offline
          Rich v
          wrote on last edited by
          #4

          Closing - files are in qrc system. Codegen errors are likely just due to some setting that is on a more sensitive setting.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved