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

"Move Component into Separate File" does not add component file to project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt Creator 10.0.0, Qt Creator 10.0.1 (10.0 branch)
    • Quick / QML Support
    • Ubuntu 22.04 LTS

    Description

      1. Open a CMake-based Qt Quick Application project.
        You can take the defaults from Creator's project wizard.
      2. In a .qml file, add a trivial item, e.g. "TextEdit {}"
      3. Right-click onto the item's name and select "Refactoring" -> "Move Component into Separate File".
      4. In the following dialog, click "OK".
        The item is being moved to a separate file.
      5. Run the project.
        In Application Output, you can read that the component you created "is not a type".

      This fails because the new component was not added to CMakeLists.txt. Adding its filename to "QML_FILES" in "qt_add_qml_module" fixes the issue.

      Found and tested by Squish test tst_QMLS04

      Attachments

        Activity

          People

            cadam Cristian Adam
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: