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

Unable to switch from .h to .c file with Switch Header/Source in some situations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 10.0.0
    • C/C++/Obj-C++ Support
    • None
    • Arch Linux installed from Arch package repository
      macOS installed from binary installer

    Description

      Attempting to use Switch Header/Source from a .h file to a corresponding .c file fails in the following situation:

      • A project is a mix of .c and .cpp files.
      • The header and source are in different folders.
      • The source file is a .c file.

       

      To reproduce:

      1. Download test.tar.gz and open in Qt Creator.
      2. Open src/TestFile.c
      3. Invoke Switch Header/Source, the editor will switch to include/TestFile.h.
      4. Invoke Switch Header/Source again, the editor will NOT switch back to src/TestFile.c.

       

      Functionality will be restored if:

      1. Main.cpp is changed to Main.c, making "test" a C-only project.
      2. include/TestFile.h is moved to the src directory, so the .c and .h files are in the same directory.
      3. TestFile.c is changed to TestFile.cpp.

      Attachments

        1. test.tar.gz
          0.4 kB
          Aaron Barany

        Activity

          People

            cadam Cristian Adam
            akb825 Aaron Barany
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: