Thank you for the suggestions. I decided to move my entire .config/QtProject to 
the side and restart QtCreator and now I seem to get the proper behavior. 
Moving the old settings back into place seems to go back to the old behavior so 
I guess there is just something in the settings file(s) that messes with the 
ability to jump to the definition versus the declaration. I’ll just consider 
this a user-error and move on… 

 

--

Mike Jackson

 

From: Adam Light <acli...@gmail.com>
Date: Friday, February 19, 2021 at 9:43 AM
To: Michael Jackson <mike.jack...@bluequartz.net>
Cc: Qt-creator <qt-creator@qt-project.org>
Subject: Re: [Qt-creator] Follow Symbol Under Cursor always takes me to the 
header file

 

 

 

On Thu, Feb 18, 2021 at 3:04 PM Michael Jackson <mike.jack...@bluequartz.net> 
wrote:

I have a .cpp file opened. I am sitting at a piece of code and I want to jump 
to the method definition, I right click and select "Follow Symbol Under 
Cursor", QtCreator takes me to the "declaration" in the header file. How do I 
get it to jump to the definition instead?

As a side note: This has *never* worked for me since I have started using 
QtCreator. I just put up with it. But this has got to be a "user error" on my 
part but I can't figure out what should be doing instead. 

 

This happens to us in some places in our code where the declaration and the 
definition of a function are not identical.

 

For example, the .h file has:

void foo(QWidget* w);

 

and the  .cpp file has:

void foo(QWidgetPtr w);

 

somewhere in our code (though perhaps not in a place that the .h file 
#includes) there is a typedef that defines QWidgetPtr as QWidget*, therefore 
the code compiles.

 

If we change the types to be the same in the .h and .cpp file, then Follow 
Symbol Under Cursor works as expected. But otherwise it only takes us to the .h 
file.

 

If it's never worked for you then this is probably not what you're running 
into, but I thought I'd mention this just in case.

 

Adam

_______________________________________________
Qt-creator mailing list
Qt-creator@qt-project.org
https://lists.qt-project.org/listinfo/qt-creator

Reply via email to