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

Qt Creator does not reparse QML following change to CMake (or even rebuild)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 6.0.1, Qt Creator 6.0.2, Qt Creator 8.0.1, Qt Creator 9.0.1
    • None
    • MacBook Pro (M1, macOS 12.1)
    • macOS

    Description

      When changes are made in CMakeLists.txt, for example adding or removing class sources from a qt_add_qml_module, the Projects window updates but QML files do not.

      Closing and opening the QML file doesn't cause it to re-parse.

      Nor does deleting the build folder and rebuilding.

      The only way to get the QML file to parse correctly is to quit Qt Creator and start it again.

      See attached showing main.qml after Age.h & Age.cpp have been added and Person.h & Person.cpp have been commented out from CMakeLists.txt as follows:

      qt_add_qml_module(People
          URI People
          VERSION 1.0
          SOURCES
          Age.h Age.cpp
      #    Person.h Person.cpp
      )
      

      The first image shows the change reflected in Projects pane but not in main.qml despite the above attempts to cause a reparse.

      The second image shows the change correctly reflected, following Qt Creator being quit and restarted.

      Attachments

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

        Activity

          People

            cadam Cristian Adam
            paulmasri Paul
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change