Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-112813

Qt6::DataVisualization has a hard dependency on Qt6::Qml

    XMLWordPrintable

Details

    • 63b27b664 (dev), 5295fc081 (6.5)

    Description

      Modules are usually split into a QML and a non-QML part. For example:

      • <QTDIR>/lib/cmake/Qt6Charts/
      • <QTDIR>/lib/cmake/Qt6ChartsQml/
      • <QTDIR>/lib/cmake/Qt6DataVisualization/
      • <QTDIR>/lib/cmake/Qt6DataVisualizationQml/

      However, the Qt Data Visualization module is not split correctly. See the *Dependencies.cmake files:

       

      Correct

      set(_Qt6Charts_MODULE_DEPENDENCIES "Core;Gui;Widgets;OpenGL;OpenGLWidgets")
      set(_Qt6ChartsQml_MODULE_DEPENDENCIES "Charts;Core;Gui;Qml;Quick;OpenGL")
      

       

      Wrong

      set(_Qt6DataVisualization_MODULE_DEPENDENCIES "Core;Gui;OpenGL;Qml;Quick")
      set(_Qt6DataVisualizationQml_MODULE_DEPENDENCIES "DataVisualization;Core;Gui;OpenGL;Qml;Quick")
      

       

      Consequences

      A non-QML project that uses the Qt Data Visualization module gets a "qmlimportscan" target

      cmake_minimum_required(VERSION 3.14)
      project(TestProj LANGUAGES CXX)
      find_package(Qt6 REQUIRED COMPONENTS Core DataVisualization)
      
      qt_add_executable(TestProj main.cpp)
      
      target_link_libraries(TestProj PRIVATE
          Qt6::Core
          Qt6::DataVisualization # <-- Comment this out to remove the qmlimportscan target
      )
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            alexandru.croitor Alexandru Croitor
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes