Autocomplete and "Find Usages" to stopped working properly in QtCreator 2.4.0 (on Windows 7 64-bit)
-
I use QtCreator 2.4.0 on Windows 7 64-bit. Until a couple of days ago autocomplete was working fine.
- Suddenly it no longer shows any completion suggestions for many member variables in various classes.
- Also I can no longer get the hyperlink to definitions and declarations of members and methods by holding down Ctrl and hovering over over them. This occurs for some items, not all.
- In addition, the "Find Usages" command no longer works for those same items that have the above problem.
Is there a QtCreator-generated database that it produces for each session or each project? I could try deleting those to see if they get recreated properly. At least that's what I had to do in Visual Studio.
I have tried Tools->C++->Update Code Model, but that did not help. I also deleted the session file C:\Users<username>\AppData\Roaming\Nokia\qtcreator<session>.qws, and recreating it - that did not help.
-
Found the issue, although I'm not sure if this considered a QtCreator bug or not.
I had 3 projects in my session. Two of those projects have a class called MainWindow. When I Ctrl+clicked on the constructor declaration in one project, it took me to the MainWindow constructor definition in the alternate project. Since the second project does not have all the members and methods of the first, the hyperlinking and connectivity was all messed up.
The question is why was QtCreator pairing the declarations and definitions from two different projects even though each project had both declarations and definitions for the respective classes.
I understanding using namespaces would have prevented this, but regardless of using the good practice or not, it seems that QtCreator should have paired it correctly (after all it was working fine for the longest time).