Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
Qt Creator 4.10.1, Qt Creator 4.10.2, Qt Creator 4.11.0-beta2, Qt Creator 4.11.0, Qt Creator 4.11.1
-
None
-
KUbuntu 19.10
Windows 10
Description
I have 2 clones of the same project:
- cpp-projects/project-a-clone1
- cpp-projects/project-a-clone2
I have opened each project in Qt Creator, never at the same time and in 2 different sessions.
When I navigate the code using Ctrl+click I can end up in files of the other project.
The most recent case is:
- Open cpp-projects/project-a-clone1 in Qt Creator
- Open cpp-projects/project-a-clone1/myclass.h
- Ctrl+Click (or F2) on the definition of the constructor MyClass()
- Qt Creator opens cpp-projects/project-a-clone2/myclass.h and set the cursor to the definition of the class (class MyClass)
- Qt Creator also shows a warning: "This file is not part of any project. The code model might have issues to parse this file properly."
- In cpp-projects/project-a-clone2/myclass.h, I Ctrl+Click (or F2) on the definition of the constructor MyClass()
- Qt Creator opens cpp-projects/project-a-clone2/myclass.cpp and brings me to the definition of the constructor
To summarize, navigation does not work inside the opened project, but works in the project that is not opened.
I noticed this first on a large project on Linux and I was able to reproduce it with a minimal project on Windows. To create it I did:
- Create "project-a" folder and "project-a/project-a.pro" in Windows explorer.
- Opened Qt Creator, create and open a new Session
- Open project-a.pro
- Add main.cpp and MyClass
- Close Qt Creator
- Make a copy of project-a folder named project-a-other
- Remove project-a.pro.user from project-a-other
- Open Qt Creator
- Create and open a new session
- Open project-a-other/project-a.pro
- Use F2 on MyClass => Qt Creator opens project-a/myclass.h instead of project-a-other/myclass.h
See "sample.zip"
When using "Find References to Symbol Under Cursor" the search results will show results from both projects.
On Linux, after I removed from disk one of the 2 projects, when trying to F2 to the definition, Qt Creator gives me an error message box saying that the cpp file from the deleted clone is missing. Even after I restarted my computer. I had to delete the content of ~/.cache/QtProject/QtCreator to make it work.
Notes Also I have experienced issues with the code model on multiples project when pressing F2 or using Ctrl+Click.
Like nothing happening, or Qt Creators navigating to someplace where a function is used instead of where it is defined.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-20276 Incorrect header resolving for headers with identical names
- Closed