Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find member variable using Locator in Qt Creator

Tags:

c++

qt

qt-creator

Qt Creator has the Locator box, which allows you to easily find classes, methods, etc. Is there a way to use it to find class member variables, as well?

Using . <expr> will show member variables too, but that is only for searching inside the current file, not globally.

This the Locator:

enter image description here

like image 415
sashoalm Avatar asked May 28 '13 13:05

sashoalm


1 Answers

By default, there is not such feature, but as said in the doc you can create a filter (I can't test it now, but I'll try this soon):

To create a locator filter:

  1. In the locator, select Options > Configure to open the Locator options.

  2. In the Filter Configuration dialog:

    1. Name your filter.
    2. Select at least one directory. The locator searches directories recursively.
    3. Define the file pattern as a comma separated list. For example, to search all .h and .cpp files, enter *.h, *.cpp
    4. Specify the prefix string.
  3. To show only results matching this filter, select Limit to prefix.

  4. Click OK.
like image 129
Thomas Ayoub Avatar answered Sep 20 '22 22:09

Thomas Ayoub