Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Precompiling QML / Recommended resources for Cmake and QML projects

Precompiling QML / Recommended resources for Cmake and QML projects

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 199 Views
  • 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.
  • K Offline
    K Offline
    Kory
    wrote on 28 Dec 2024, 08:47 last edited by Kory
    #1

    Made some progress with precompiling QML for a number of modules but I'm stuck with making it work with a button module, making use of QtQuick controls

    Posted about it on Stack Overflow
    https://stackoverflow.com/questions/79309283/cant-compile-the-qml-base-type-button-to-c-because-it-lives-in-qtquick-con

    The error I had was

    import\qml_module\ButtonsModule\ButtonBase.qml:5: error: Can't compile the QML base type "Button" to C++ because it lives in "QtQuick.Controls.Material" instead of the current file's "ButtonsModule" QML module. [compiler]
    

    Does anyone have any idea what this error message is referring to and how I might be able to get past it? Wondering as well if there any recommended resources where all of this is documented. Like Cmake for mobile development projects using QML.

    J 1 Reply Last reply 30 Dec 2024, 06:36
    0
    • K Kory
      28 Dec 2024, 08:47

      Made some progress with precompiling QML for a number of modules but I'm stuck with making it work with a button module, making use of QtQuick controls

      Posted about it on Stack Overflow
      https://stackoverflow.com/questions/79309283/cant-compile-the-qml-base-type-button-to-c-because-it-lives-in-qtquick-con

      The error I had was

      import\qml_module\ButtonsModule\ButtonBase.qml:5: error: Can't compile the QML base type "Button" to C++ because it lives in "QtQuick.Controls.Material" instead of the current file's "ButtonsModule" QML module. [compiler]
      

      Does anyone have any idea what this error message is referring to and how I might be able to get past it? Wondering as well if there any recommended resources where all of this is documented. Like Cmake for mobile development projects using QML.

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 30 Dec 2024, 06:36 last edited by JKSH
      #2

      Hi @Kory, this is a current limitation of the QML Type Compiler: https://doc.qt.io/qt-6/qtqml-qml-type-compiler.html#known-limitations

      Imported QML modules that consist of QML-defined types (such as QtQuick.Controls) might not get compiled correctly, even if those QML-defined types were compiled by qmltc.. At present, you can reliably use QtQml and QtQuick modules as well as any other QML module that only contains C++ classes exposed to QML.

      Note: The Type Compiler is only one part of precompilation. You can still use the Script Compiler: https://doc.qt.io/qt-6/qtqml-qml-script-compiler.html

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kory
        wrote on 30 Dec 2024, 14:15 last edited by
        #3

        Oh right, thanks for letting me know. At least I know it's not something I've done wrong

        1 Reply Last reply
        0

        1/3

        28 Dec 2024, 08:47

        • Login

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