Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to locate C/C++ macros?
Forum Updated to NodeBB v4.3 + New Features

How to locate C/C++ macros?

Scheduled Pinned Locked Moved Qt Creator and other tools
7 Posts 2 Posters 2.8k Views 1 Watching
  • 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.
  • I Offline
    I Offline
    initialdp
    wrote on last edited by
    #1

    Hi,

    I am using QT creator V2.7.1 in Kubuntu system and want to say I like Qt creator, it is great!

    In the 'Tools / locate ...' dialog (or input area), I can find several methods to locate C/C++ class or functions, but I cannot locate C/C++ macro there. In our C/C++ projects, there are lots of macro definitions, so it is important for us to locate them.

    Is there any configuration or plugin to fit this requirement? or will qt creator team consider to provide it in future?

    Thanks.

    1 Reply Last reply
    0
    • I Offline
      I Offline
      initialdp
      wrote on last edited by
      #2

      BTW, I tried sublime text, it is easy to locate symbols including macro, enum, union, and so on. But it is not a professional C/C++ IDE, so I think it could be great if qt creator can provide such 'locate symbol' functions.

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        Hi,

        Hover your mouse over the macro and press F2 (or right-click the macro and select "Follow Symbol Under Cursor"). The right-click menu also contains other nice shortcuts you might be interested in.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • I Offline
          I Offline
          initialdp
          wrote on last edited by
          #4

          Well, that's not what I want. 'F2' is used to find the location of macro under cursor. I want to locate (or search) a macro/enum/union in the same way we locate a function.

          For example, the macro is 'INC_OPT_XXXXX', then in 'locate ...' area, we only need input ': INC_OPT', then IDE prompts all macros whose header is 'INC_OPT'. This is the exact way how qt creator find a function or class.

          1 Reply Last reply
          0
          • JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            If I click on the magnifying glass on the left of the "locate" area, I get an option that says "Macros", along with "Classes", "Functions", etc.

            It doesn't seem to work for me though; might need a bug report.

            I'm using Qt Creator 2.8.2 on Windows 8.1 x64

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0
            • I Offline
              I Offline
              initialdp
              wrote on last edited by
              #6

              Hi JKSH,

              I think such "Macros" in "locate ..." is Qt creator's macro, not C/C++ macros.

              1 Reply Last reply
              0
              • JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                Ah, you're right.

                I'm not aware of a dedicated feature for macro searching in Qt Creator yet. You can submit a feature request at https://bugreports.qt-project.org/

                In the meantime, you can try using Ctrl+Shift+F to search for macros in your project.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                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