Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Navigate Qt Source Code in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Navigate Qt Source Code in Qt Creator

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • DiracsbracketD Offline
    DiracsbracketD Offline
    Diracsbracket
    wrote on last edited by
    #1

    Hi.
    I know that stepping into Qt Source Code when debugging is possible. I have set this up in Windows and it works (I was tricked at first into thinking that I needed to build the Qt libraries from source in order for this to work, and which I did, but that is not at all necessary. You only need the source and create the mapping in the Debugger settings).

    However, I would find it much more useful if I could directly navigate to the implementation of a Qt method from the editor, via Follow symbol under cursor and Switch between function declaration/definition.

    Follow symbol under cursor works to view definitions in the Qt headers, but it does not work with Qt Source files. Why is there no such functionality although the full source is available?

    VRoninV 1 Reply Last reply
    1
    • DiracsbracketD Diracsbracket

      Hi.
      I know that stepping into Qt Source Code when debugging is possible. I have set this up in Windows and it works (I was tricked at first into thinking that I needed to build the Qt libraries from source in order for this to work, and which I did, but that is not at all necessary. You only need the source and create the mapping in the Debugger settings).

      However, I would find it much more useful if I could directly navigate to the implementation of a Qt method from the editor, via Follow symbol under cursor and Switch between function declaration/definition.

      Follow symbol under cursor works to view definitions in the Qt headers, but it does not work with Qt Source files. Why is there no such functionality although the full source is available?

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      @Diracsbracket said in Navigate Qt Source Code in Qt Creator:

      Why is there no such functionality although the full source is available?

      i think it's because the source is not added to the build tree so the tool did not map it internally.

      I find that, to navigate the source code of qt, the web tool of woboq is super useful. You can simply click on functions and variables to have the "Follow symbol under cursor" and "Switch between function declaration/definition" effect. It's also very easy to search stuff into it

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      DiracsbracketD 1 Reply Last reply
      7
      • VRoninV VRonin

        @Diracsbracket said in Navigate Qt Source Code in Qt Creator:

        Why is there no such functionality although the full source is available?

        i think it's because the source is not added to the build tree so the tool did not map it internally.

        I find that, to navigate the source code of qt, the web tool of woboq is super useful. You can simply click on functions and variables to have the "Follow symbol under cursor" and "Switch between function declaration/definition" effect. It's also very easy to search stuff into it

        DiracsbracketD Offline
        DiracsbracketD Offline
        Diracsbracket
        wrote on last edited by
        #3

        @VRonin said in Navigate Qt Source Code in Qt Creator:

        i think it's because the source is not added to the build tree so the tool did not map it internally.

        I don't really understand what that means, but the Woboq online source navigator is great for sure; thanks for the link. So now all that needs to be done is find to an interface from Qt Creator to Woboq... ;-)

        VRoninV 1 Reply Last reply
        0
        • DiracsbracketD Diracsbracket

          @VRonin said in Navigate Qt Source Code in Qt Creator:

          i think it's because the source is not added to the build tree so the tool did not map it internally.

          I don't really understand what that means, but the Woboq online source navigator is great for sure; thanks for the link. So now all that needs to be done is find to an interface from Qt Creator to Woboq... ;-)

          VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          @Diracsbracket said in Navigate Qt Source Code in Qt Creator:

          I don't really understand what that means

          [disclaimer: an amount of simplification and speculation is involved in the below]
          To enable "Follow symbol under cursor" and "Switch between function declaration/definition" Qt creator does not search the files every time. It creates a database from all the files in your .pro. The Qt source is not scanned to build such a db so the functionality is not available

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          DiracsbracketD 1 Reply Last reply
          0
          • VRoninV VRonin

            @Diracsbracket said in Navigate Qt Source Code in Qt Creator:

            I don't really understand what that means

            [disclaimer: an amount of simplification and speculation is involved in the below]
            To enable "Follow symbol under cursor" and "Switch between function declaration/definition" Qt creator does not search the files every time. It creates a database from all the files in your .pro. The Qt source is not scanned to build such a db so the functionality is not available

            DiracsbracketD Offline
            DiracsbracketD Offline
            Diracsbracket
            wrote on last edited by
            #5

            @VRonin said in Navigate Qt Source Code in Qt Creator:

            The Qt source is not scanned to build such a db so the functionality is not available

            Then, would it be overly complicated/too much of a hassle to create such functionality? If people are willing to compile Qt from source, I'm sure they wouldn't mind the extra processing to generate such a DB.

            1 Reply Last reply
            0
            • VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              You can probably just add qt.pro file to your project but don't expect it to be lightweight

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              DiracsbracketD 1 Reply Last reply
              0
              • VRoninV VRonin

                You can probably just add qt.pro file to your project but don't expect it to be lightweight

                DiracsbracketD Offline
                DiracsbracketD Offline
                Diracsbracket
                wrote on last edited by
                #7

                @VRonin said in Navigate Qt Source Code in Qt Creator:

                You can probably just add qt.pro file to your project but don't expect it to be lightweight

                I tried that, and indeed it is not a workable solution. Thanks :-)

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved