[Qt-creator] Find references of virtual functions?

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Sat Sep 12 00:27:55 CEST 2020

Il 11/09/20 22:59, Murphy, Sean ha scritto:
> Is there any way in Qt Creator to only show me the places where Grandchild::foo() is called?  Right now, I'm finding that even if I go to grandchild.cpp, put my cursor on void Grandchild::foo(), and then select "Find Reference to Symbol Under Cursor", it shows me every instance of EVERY foo() called anywhere in the program, including the declarations/definitions of Abstract::foo(), Base::foo() and Child::foo(), which I don't care about at the moment.

By "every foo()" do you mean even the ones completely unrelated to your 
class hierarchy, or all the foo() in the hierarchy?

Anyhow, given it's a virtual, how can you know at compile time if you're 
calling GrandChild::foo() or not?

Abstract *blah = getFoo();
blah->foo(); // might call Grandchild::foo(), or not

My 2 c,

Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20200912/bb75927b/attachment.bin>

More information about the Qt-creator mailing list