[Previous: The Code Editor]
[Qt Creator Manual]
[Next: Session Management in Qt Creator]
Navigating Around Your Code with Locator
With Qt Creator, navigating to different locations in your project or on your disk, e.g., files, classes, methods, etc., is simple using Locator -- a smart line edit at the bottom left in Qt Creator window.

For example, to open your project's main.cpp file:
- Click on Locator or press Ctrl+K (Mac OS X: Cmd+K).
- Type in the file name.
- Press Return.
The file opens in the editor.
You can also type part of a file name and use the wildcard characters * and ? to match any number of any characters. A list of files matching your criteria is displayed.
Locator allows you to navigate files both on disk and in other "locations", which are organized with Filters. There are filters for:
- Files anywhere on your hard disk (browsing through the file system)
- Files from a subdirectory structure defined by you
- Files mentioned in your .pro files, such as source, header resource, and .ui files
- Any open document
- Class and method definitions in your project or anywhere referenced from your project
- Help topics, including Qt's documentation
- Specific line in the document displayed on your editor
Some of these filters require you to activate them by typing an assigned prefix. This prefix is usually a single character followed by Space. For example, to jump to the definition of the class QDataStream, activate Locator. Then type a colon (:) followed by a Space and the class name.
Below is a full list of QDataStream related output:

Filters can be added to provide quick navigation around files in a subdirectory structure defined by you. This way, you can acccess files you need that are not directly mentioned in your project.
- Click the button

- Select Configure... from the menu displayed:

- To create a new filter, select Add from the Configure... dialog (Options on Mac Os X).
- In the Filter Configuration dialog below:
- Give your filter a name.
- Select your preferred directories.
- Set file patterns with a comma separated list.
- Specify a prefix string.

- Close the dialog.
Locator searches the directories you selected for files matching your file patterns. Information is cached. To update the cached information:
- Click the button

- Select Refresh.
The following table lists available filters:
Function | Key Combination | Screenshot |
Go to a line in the current document. | Ctrl+K, l, Space, and the line number | 
|
Go to a symbol definition. | Ctrl+K, :, Space, and the function name | 
|
Go to a help topic. | Ctrl+K, ?, Space, and the topic | 
|
Go to an opened document. | Ctrl+K, o, Space, and the document name | 
|
Go to a file in the file system (browse the file system). | Ctrl+K, f, Space, and the file name | 
|
Go to a file in any project currently loaded. | Ctrl+K, a, Space, and the function name | 
|
Go to a file in the current project. | Ctrl+K, p, Space, and the function name | 
|
Go to a class definition. | Ctrl+K, c, Space, and the class name | 
|
Go to a method definition. | Ctrl+K, m, Space, and the class name | 
|
Note: By default, if you press Ctrl+K and do not use a prefix to specify a filter, three filters are enabled: o, l, and a.
Note: On Mac OS X, press Cmd+K instead of Ctrl+K.
[Previous: The Code Editor]
[Qt Creator Manual]
[Next: Session Management in Qt Creator]
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) |
Trademarks |
Qt Creator 1.3.1 |
|