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