Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-14574

'mockImports' variable in .qmlproject does not ignore QML export in it as expected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • QDS 4.7.0
    • QDS 4.6.2
    • CMake exporter
    • None
    • Qt Design Studio 4.6.2
      Windows 11 23H2
    • QDS Berlin - 2025 Week 3/4, QDS Berlin - 2025 Week 5/6, QDS Berlin - 2025 Week 7/8

    Description

      • Unzip attached example 'QtDS_BUG_Demo.zip'
      • Open 'QtDS_BUG_Demo.qmlproject' with Qt Design Studio
      • Note: 'CMake Generator' is enabled,'QtDS_BUG_Demo.qmlproject' Line 24 'mockImports' variable contains item "mock"
      • EXPECTED: 'CMakeLists.txt' is not generated in 'mock' folder, 'qds.cmake' does not contain 'add_subdirectory(mock)'
      • ACTUAL: 'CMakeLists.txt' is generated in 'mock' folder,'qds.cmake' contains 'add_subdirectory(mock)' line, which conflicts with the real library, resulting in an error when compiling in Qt Creator, as shown below:
      • [cmake] CMake Error at D:/Qt/6.8.0/msvc2022_64/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:539 (message):
        [cmake]   Output directory for target "MyObject" is already used by another QML
        [cmake]   module (target "Myobject").  Output directory is:
        [cmake] 
        [cmake]     C:/Users/username/Documents/QtDS_BUG_Demo/build/Desktop_Qt_6_8_0_MSVC2022_64bit-Debug/qml/MyObject
        [cmake] 
        [cmake] Call Stack (most recent call first):
        [cmake]   mock/MyObject/CMakeLists.txt:7 (qt6_add_qml_module)
        [cmake] 
        [cmake] 
        [cmake] -- Configuring incomplete, errors occurred! 

         

      Attachments

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

        Activity

          People

            knud Knud Dollereder
            tian Zhiyuan Tian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes