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 200 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.
  • KoryK Offline
    KoryK Offline
    Kory
    wrote on 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.

    JKSHJ 1 Reply Last reply
    0
    • KoryK Kory

      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.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on 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
      • KoryK Offline
        KoryK Offline
        Kory
        wrote on 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

        • Login

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