Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Qt Creator "Follow Symbol Under Cursor"

    Tools
    qt creator file navigation
    2
    3
    3811
    Loading More Posts
    • 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.
    • S
      stoptherock1 last edited by stoptherock1

      Hello everyone,

      I find "Follow Symbol Under Cursor" feature very useful and I use it frequently in my everyday work. But there is one issue, which sometimes makes this feature totally useless.
      Mostly I am working with C/C++ projects in Qt Creator and if I have some function defined in 1 header (interface), but there is several different implementations (depending on build configuration), pressing the "Follow Symbol Under Cursor" shortcut just moves me to one of the implementations, so I have no chance to choose, in which implementation I am interested in right now.
      From my point of view, it will be more useful, if in case of more than 1 implementation Qt Creator will ask me about it (some drop-down list, for example), so I will be able to choose particular implementation.

      Is there any additional configuration options in Qt Creator, which I should check, or there is no such functionality so far?

      UPDATE: I've created a suggestion ticket Qt's JIRA:
      https://bugreports.qt.io/browse/QTCREATORBUG-14257

      1 Reply Last reply Reply Quote 0
      • Jeroentjehome
        Jeroentjehome last edited by

        Hi,
        The solution is in multiple files. When you have multiple definitions of your functions and only 1 declaration you should place those definitions into multiple files and in your project file include the right cpp or c file that holds the wanted definition.
        e.g.
        #(CONFIGURED_A) // Or something like this, read the docs
        SOURCES += MyFirstFile.c
        #else
        SOURCES += MySecondFile.c
        #endif

        Greetz, Jeroen

        S 1 Reply Last reply Reply Quote 1
        • S
          stoptherock1 @Jeroentjehome last edited by stoptherock1

          @Jeroentjehome
          Thanks for the reply. It fixes the problem, for sure.
          But in the other hand such feature would be very useful.
          I will create a feature request and post it here later, if somebody else is also interested.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post