Home

This documentation is out of date. Please refer to the latest version.

[Previous: Qt Creator and Version Control Systems] [Qt Creator Manual] [Next: Debugging with Qt Creator]

Navigating Quickly 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 trivial using Locator -- a smart line edit at the bottom left of Qt Creator's window.

Suppose you would like to open your project's main.cpp file, click on Locator or use Ctrl+K, type in the file name and then press Return. The file will be opened 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 all files matching your criteria will be displayed.

Locator not only allows you to navigate files on disk but also other "locations", which are organized with Filters. Currently there are filters for:

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, type: Ctrl+K to activate Locator. Then type colon (:) followed by 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 on

and choose Configure... from the menu displayed.

This displays the Preferences dialog (Options on Mac Os X) for navigation filters. Click Add to create a new filter. In the Filter Configuration dialog below, give your filter a name, select your preferred directories, set file patterns with a comma separated list, and specify a prefix string.

After closing this dialog, Locator will search the directories you selected for files matching your file patterns, and the information will be cached. Click Refresh from the menu above to update the cached information.

The following table lists the filters currently available:

FunctionKey CombinationScreenshot
Go to a line in the current documentCtrl+K, l, Space, and the line number

Go to a symbol definitionCtrl+K, :, Space, and the function name

Go to a help topicCtrl+K, ?, Space, and the topic

Go to an opened documentCtrl+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 loadedCtrl+K, a, Space, and the function name.

Go to a file in the current projectCtrl+K, p, Space, and the function name.

Go to a class definitionCtrl+K, c, Space, and the class name.

Go to a method definitionCtrl+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 will be enabled: o, l, and a.

[Previous: Qt Creator and Version Control Systems] [Qt Creator Manual] [Next: Debugging with Qt Creator]


Copyright © 2009 Nokia  
Qt Creator 1.1.0