Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-30218

Failing to add a new QML file in qt_add_qml_module()

    XMLWordPrintable

Details

    • 5e6f1f5da (12.0)

    Description

      When using a CMake variable to set the target in qt_add_executable() and qt_add_qml_module() , a new qml file is added in qt_add_executable(), not in qt_add_qml_module().

      Steps performed:

      1. Create a new Qt Quick project
      2. Replace the target name in qt_add_executable() and qt_add_qml_module() with ${PROJECT_NAME}
      3. Right click on target name in the project source tree and select Add New... > Qt > QML File
      4. The QML file is created and added to qt_add_executable in CMakeLists.txt

       

      Before a new qml file is added:

       

      project(myapp VERSION 0.1 LANGUAGES CXX)
      qt_add_executable(${PROJECT_NAME}
         main.cpp
      )
      qt_add_qml_module(${PROJECT_NAME}
         URI test
        VERSION 1.0
        QML_FILES
         Main.qml   
      )
       
      

       

      After the new qml file is added:

       

      qt_add_executable(${PROJECT_NAME}
        main.cpp
        Test.qml //It should be added in qt_add_qml_module
      )
      qt_add_qml_module(${PROJECT_NAME}
         URI test
        VERSION 1.0
        QML_FILES
        Main.qml
      )
      

       

      Attachments

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

        Activity

          People

            cadam Cristian Adam
            dongmei Dongmei Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes