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

Adding/removing a file to/from a "dirty" CMakeLists.txt corrupts it

XMLWordPrintable

    • e892a6224 (11.0)

      The example below shows corruption in qt_add_qml_module() but it also happens when you add/remove files to, say, qt_add_executable(). It looks like there's a mismatch between the text and the text cursor.

       

      Steps to reproduce

      1. Load the attached project in Qt Creator and open CMakeLists.txt in the code editor
      2. In the code editor, insert an empty line somewhere inside qt_add_qml_module() but don't save your changes
      3. In the Projects view, right-click the main target ("appCMakeCorruptionBug") and select "Add Existing Files..." > "ExtraItem.qml"

       

      Outcome
      You end up with a corrupted CMakeLists.txt like

      qt_add_qml_module(appCMakeCorruptionBug
      
          URI CMakeCorruptionBug
          VERSION 1.0
          QM
          QML_FILES ExtraItem.qmlL_FILES Main.qml
      )
      

       

      Workaround
      Get into the habit of saving your project before adding/removing files

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

            cadam Cristian Adam
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes