Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Working example using ENABLE_TYPE_COMPILER
Qt 6.12 LTS is out! See what's new in the release blog

Working example using ENABLE_TYPE_COMPILER

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 4 Posters 1.2k 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.
  • FalsinSoftF Offline
    FalsinSoftF Offline
    FalsinSoft
    wrote on last edited by
    #1

    Hi all

    I moved my android app from qt 5 to new version6 but I'm still unable to compile the qml files into c++. Based to the documentation is required to add the ENABLE_TYPE_COMPILER to qt_add_qml_module() but it doesn't compile. One of the error is :

    Error: QtQuick.Controls uses optional imports which are not supported. Some types might not be found

    Explanation for this error is here but solution proposed doesn't work for me and I receive always the same error. I can not find a working example using this flag (I'm compiling for android). Someone can link me to some example around (if exist)?
    Thank you

    1 Reply Last reply
    3
    • S Offline
      S Offline
      SomeWhat
      wrote on last edited by
      #2

      Same error here, using qt 6.5.2, also tested with qt 6.5.1

      the qt_add_qml_module in cmake:

      qt_add_qml_module(appThings
          URI Things
      	RESOURCE_PREFIX /
          VERSION 1.0
      	NO_PLUGIN
      	DEPENDENCIES
      		QtQuick
      	IMPORTS
      		${QUICK_CONTROLS} # same as in given source
      	SOURCES
                  ...
              QML_FILES
                  ...
              RESOURCES
                  ...
              ENABLE_TYPE_COMPILER
      )
      
      1 Reply Last reply
      1
      • S Offline
        S Offline
        Sazonov
        wrote on last edited by
        #3

        Same here, not working. Trying to do it based on this article: https://www.qt.io/blog/compiling-qml-to-c-qtquick-controls-and-optional-imports

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kai Nickel
          wrote on last edited by
          #4

          Apparently this has something to do with QtQuick.Controls dynamically loading styles as runtime. See this post:

          https://www.qt.io/blog/compiling-qml-to-c-qtquick-controls-and-optional-imports

          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
          • Unsolved