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

Document that files belonging to a QML module have to be in that QML module's directory.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.5.6, 6.8
    • QML: Compiler
    • None
    • testing in Windows 11 / 64

    Description

      *REPORTED PROBLEM*
      in cmakelist.txt cannot include QML files which starts with ../ relative path
      for example
      qt_add_qml_module(test
      QML_FILES
      ../test/resource/Main.qml
      )

      *HOW TO REPRODUCE THE PROBLEM*

      cmake_minimum_required(VERSION 3.16)
      project(test VERSION 1.28 LANGUAGES CXX DESCRIPTION "test")

      set(CMAKE_AUTOMOC ON)
      set(CMAKE_AUTORCC ON)

      ....
      .....

      qt_add_qml_module(test
      VERSION 1.28
      URI "testmod"
      RESOURCE_PREFIX "/"

      QML_FILES
      ../test/resource/Main.qml
      )

      set_target_properties(test
      PROPERTIES
      QT_QML_CACHEGEN_ARGUMENTS "--direct-calls")

      etc.

      then, when compiling QML files QtCreator 13.01 generates these errors :

      Error creating directory "D:/bin/test/windows/64/.rcc/qmlcache/testmod_../test/resource".
      jom: D:\bin\test\windows\64\CMakeFiles\testmod.dir\build.make [.rcc\qmlcache\guimod_..\test\resource\main_qml.cpp] Error 1
      Error creating directory "D:/bin/test/windows/64/.rcc/qmlcache/testmod_../test/resource/qmlpage".

      REQUEST
      Someone knows a solution to add QML files with ../ relative path ? Thank you !

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            ropar Roberto Paron
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes