Home · Editor · Code Navigation · Shortcuts · Wiki

[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:

  1. Click on Locator or press Ctrl+K (Mac OS X: Cmd+K).
  2. Type in the file name.
  3. 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:

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.

  1. Click the button

  2. Select Configure... from the menu displayed:

  3. To create a new filter, select Add from the Configure... dialog (Options on Mac Os X).
  4. In the Filter Configuration dialog below:

  5. Close the dialog.

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

  1. Click the button

    again.

  2. Select Refresh.

The following table lists available filters:

FunctionKey CombinationScreenshot
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.0