Auto location of routines in Qt creator


  • Moderators

    I have a rather large class with numerous of short access routines. Therefore, I had decided to inline implementations for those access routines.
    Since the class declaration including the inline after the class declaration grew out of proportion I decided to the whole header file into two sections. One section holds only the class declaration (MyClass_decl.h) and the other section holds the inline routines (MyClass_impl.h). My initial large header file shrinks to basically two entries including those new header header files.

    MyClass.h

    #include "MyClass_decl.h"
    #include "MyClass_impl.h"
    

    The header "MyClass.h" is included whereever I need as before.
    Compilation and all works fine. However, I have problems with Qt creator's locator functionality. When placing the cursor on an access routine and pressing F2 I can find only the access routines declaration in the header file, now "MyClass_decl.h", but not the actual implementation in "MyClass_impl.h". Also when placing the cursor on the inline implementation the actual calls to the access function in my source are not found. Overall this is getting quite a nusiance.

    Has anyone mastered to convince Qt creator to operate as traditionally in such setups?


  • Moderators

    I didn't ;-) One idea that comes to my mind is to try it out with clang code model vs. the standard one. Maybe one will work better than the other in that regard.


  • Moderators

    @sierdzio

    Super!

    That does the trick.

    At first I looked around for changing to clang code model and found a setting that could not be activated because clang code model plugin was not loaded. After activation/loading of clang code model plugin the locator does what I need.

    I needed to include "MyClass_decl.h" also in "MyClass_impl.h" otherwise the plugin was complaining.

    At the moment I saw only that loading the proejcts took ages, but could be a result of first loading process. Will keep an eye on this part.

    Thanks a lot.


  • Moderators

    @koahnig said in Auto location of routines in Qt creator:

    At the moment I saw only that loading the proejcts took ages, but could be a result of first loading process. Will keep an eye on this part.

    Yes, many people say that clang model is slower for them. I don't notice that on modern QtC versions (but possibly because I'm on SSD drive & Linux so IO is not a bottleneck).


  • Moderators

    @sierdzio

    It is the latest version of Qt creator (4.2.1), but unfortunately with the debugging issue for standard containers. I did not manage to install a previous version in addtion, yet.

    I do not have an SSD yet. Still on the wishlist as basically the whole new machine is. :(


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.