Doc: Remove details about locator filters and refer to tooltips
- Reorganize the topic contents, so that all examples are in one place - Add subtitles - Update screenshots Task-number: QTCREATORBUG-28996 Change-Id: Id139b19c5ff18c08b7a27494d6ac5051b298c014 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Before Width: | Height: | Size: 12 KiB |
BIN
doc/qtcreator/images/qtcreator-add-online-doc.webp
Normal file
After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 22 KiB |
BIN
doc/qtcreator/images/qtcreator-locator-customize.webp
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB |
BIN
doc/qtcreator/images/qtcreator-locator-example.webp
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
BIN
doc/qtcreator/images/qtcreator-locator-open.webp
Normal file
After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 13 KiB |
BIN
doc/qtcreator/images/qtcreator-locator.webp
Normal file
After Width: | Height: | Size: 8.0 KiB |
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2021 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -15,7 +15,9 @@
|
|||||||
To open it as a centered popup, click \inlineimage icons/magnifier.png
|
To open it as a centered popup, click \inlineimage icons/magnifier.png
|
||||||
(\uicontrol Options) in it and select \uicontrol {Open as Centered Popup}.
|
(\uicontrol Options) in it and select \uicontrol {Open as Centered Popup}.
|
||||||
|
|
||||||
\image qtcreator-locator.png "List of locator filters"
|
\image qtcreator-locator.webp "List of locator filters"
|
||||||
|
|
||||||
|
\section1 Activating the Locator
|
||||||
|
|
||||||
To activate the locator:
|
To activate the locator:
|
||||||
|
|
||||||
@@ -32,43 +34,35 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
To open a QML file called \e HelloWorld.qml in the currently open project
|
\section1 Using Locator Filters
|
||||||
using the locator:
|
|
||||||
|
|
||||||
\list 1
|
You can locate not only files, but any items defined by \e{locator filters},
|
||||||
|
as well as trigger global actions and perform other tasks, such as build
|
||||||
|
projects or run external tools.
|
||||||
|
|
||||||
\li Activate the locator by pressing \key {Ctrl+K}.
|
The filters that are available depend on the file type. For more information
|
||||||
|
about what a particular locator filter does, see the tooltips that appear
|
||||||
|
when you hover over a filter in the locator. For longer descriptions of the
|
||||||
|
filters, select \uicontrol Configure to open the \uicontrol Locator
|
||||||
|
\l{Creating Locator Filters}{preferences}.
|
||||||
|
|
||||||
\li Start typing the filename.
|
To use a locator filter, type its prefix followed by \key Space. The prefix
|
||||||
|
is usually short, from one to three characters. Then type the search string
|
||||||
|
(for example, a filename or class name) or the command to execute.
|
||||||
|
|
||||||
\image qtcreator-locator-open.png "List of files found in the locator"
|
You can also double-click a locator filter in the filter list to use it. Use
|
||||||
|
the up and down arrow keys or the \key Ctrl+P and \key Ctrl+N
|
||||||
|
keyboard shortcuts to move up and down the list, and then press \key Enter
|
||||||
|
to use the selected filter.
|
||||||
|
|
||||||
\li Move to the filename in the list and press \key Enter.
|
As you type a search string,
|
||||||
|
|
||||||
The file opens in the editor.
|
|
||||||
|
|
||||||
\li To move to a line in the file, enter the line number in the locator.
|
|
||||||
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
To move directly to a particular line and column in the document when you
|
|
||||||
open the document, append them to the file name in the locator, separated by
|
|
||||||
plus signs (+) or colons (:). For example, to open \e HelloWorld.qml to line
|
|
||||||
41 and column 2, enter: \c {HelloWorld.qml:41:2}.
|
|
||||||
|
|
||||||
If the path to a file is very long, it might not fit into the locator
|
|
||||||
window. To view the full path, press \key Alt when the filename is selected
|
|
||||||
or use the handle next to the locator window to increase the window width.
|
|
||||||
|
|
||||||
It is also possible to enter only a part of a search string. As you type,
|
|
||||||
the locator shows the occurrences of that string regardless of where in the
|
the locator shows the occurrences of that string regardless of where in the
|
||||||
name of an component it appears. Some locator filters, such as colon, \c m,
|
name of an component it appears. Some locator filters, such as colon, \c m,
|
||||||
and \c t, support \e fuzzy matching, which means that you can enter the
|
and \c t, support \e fuzzy matching, which means that you can enter the
|
||||||
uppercase letters to locate a symbol when using camel case or the letters
|
uppercase letters to locate a symbol when using camel case or the letters
|
||||||
after the underscore when using snake case.
|
after the underscore when using snake case.
|
||||||
|
|
||||||
To narrow down the search results, you can use the following wildcard
|
To narrow down the search results, use the following wildcard characters:
|
||||||
characters:
|
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
@@ -78,117 +72,69 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Using Locator Filters
|
\section2 Locating Files
|
||||||
|
|
||||||
The locator enables you to browse not only files, but any items defined by
|
For example, to open a QML file called \e HelloWorld.qml in the currently
|
||||||
\b{locator filters}. The filters that are available depend on the file type:
|
open project using the locator:
|
||||||
|
|
||||||
\list
|
\list 1
|
||||||
|
|
||||||
\li Locating any open document (\c {o})
|
\li Press \key {Ctrl+K} to activate the locator.
|
||||||
|
|
||||||
\li Locating files anywhere on your file system (\c {f}). You can use
|
\li Start typing the filename.
|
||||||
environment variables in the \c {f} filter. For example, use
|
|
||||||
\c {f $ENVVAR} to expand the environment variable \c ENVVAR on Unix
|
|
||||||
systems and \c {f %ENVVAR%} to expand it on Windows systems.
|
|
||||||
|
|
||||||
\li Locating files belonging to your project (\c {p}), such as source,
|
\image qtcreator-locator-open.webp "List of files found in the locator"
|
||||||
header, resource, and \c {.ui} files, or to any project (\c {a})
|
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\li Use the arrow keys to move to the filename in the list and press
|
||||||
\li Locating bookmarks (\c {b}).
|
\key Enter.
|
||||||
For more information, see \l{Using Bookmarks}.
|
|
||||||
|
|
||||||
\li Locating class (\c {c}), enum, function (\c {m}), and type alias
|
The file opens in the editor.
|
||||||
definitions in your project or anywhere referenced from your
|
|
||||||
project (\c {:})
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\li Locating QML methods (\c {m})
|
\li To move to a line in the file, enter the line number in the locator.
|
||||||
|
|
||||||
\li Locating symbols in the current document (\c {.})
|
|
||||||
|
|
||||||
\li Locating a specific line and column in the document displayed in
|
|
||||||
your editor (\c {l <line_number>:<column_number>})
|
|
||||||
|
|
||||||
\li Opening help topics, including Qt documentation (\c {?})
|
|
||||||
|
|
||||||
\li Performing web searches (\c {r})
|
|
||||||
|
|
||||||
\if defined(qtcreator)
|
|
||||||
\li Running text editing macros that you record and save (\c {rm}). For
|
|
||||||
more information, see \l{Using Text Editing Macros}
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\li Executing JavaScript (\c {=}), especially useful for calculations.
|
|
||||||
For more information, see \l{Executing JavaScript}.
|
|
||||||
|
|
||||||
\li Executing shell commands (\c {!})
|
|
||||||
|
|
||||||
\li Executing version control system commands
|
|
||||||
\if defined(qtcreator)
|
|
||||||
(\c {bzr}, \c {cvs}, \c {git}, \c {hg}, or \c {svn}).
|
|
||||||
For more information, see \l{Using Version Control Systems}.
|
|
||||||
\else
|
|
||||||
(\c {git}). For more information, see \l{Using Git}.
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\li Triggering actions (\c {t})
|
|
||||||
|
|
||||||
\li Searching for issues from the \l{https://bugreports.qt.io/}
|
|
||||||
{Qt Project Bug Tracker} (\c bug).
|
|
||||||
|
|
||||||
\li Searching for applications, documents, and other files by using
|
|
||||||
platform-specific external tools or commands (\c md). The following
|
|
||||||
tools are used by default, but you can configure the locator to
|
|
||||||
use any other command:
|
|
||||||
|
|
||||||
\list
|
|
||||||
\li On \macOS: using Spotlight
|
|
||||||
\li On Windows: using \l{https://www.voidtools.com/downloads/}
|
|
||||||
{Everything}
|
|
||||||
\li On Linux: using the \c Locate command
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
\if defined(qtcreator)
|
|
||||||
\li Running external tools (\c x)
|
|
||||||
\li Using CMake to build the project for the current run configuration
|
|
||||||
(\c {cm}). For more information, see \l {Setting up CMake}.
|
|
||||||
\li Opening the CMakeLists.txt file for the current run configuration in
|
|
||||||
the editor (\c {cmo}). This is the same build target as when you
|
|
||||||
select \uicontrol Build > \uicontrol {Build for Run Configuration}.
|
|
||||||
\li Running a particular run configuration (\c {rr} \e {<name>})
|
|
||||||
\li Switching to a particular run configuration (\c {sr} \e {<name>})
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
To use a specific locator filter, type the assigned prefix followed by
|
If the path to a file is very long, it might not fit into the locator
|
||||||
\key Space. The prefix is usually a single character. Then type the search
|
window. To view the full path, press \key Alt when the filename is selected
|
||||||
string (typically, a filename or class name) or the command to execute.
|
or use the handle next to the locator window to increase the window width.
|
||||||
|
|
||||||
You can also double-click a locator filter in the filter list to use it. You
|
|
||||||
can use the up and down arrow keys or the \key Ctrl+P and \key Ctrl+N
|
|
||||||
keyboard shortcuts to move up and down the list, and then press \key Enter
|
|
||||||
to use the selected filter.
|
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
For example, to locate symbols matching QDataStream:
|
If the locator does not find some files, see \l{Specifying Project Contents}
|
||||||
|
for how to make them known to the locator.
|
||||||
|
\endif
|
||||||
|
|
||||||
|
\section2 Locating Lines and Columns
|
||||||
|
|
||||||
|
To move directly to a particular line and column in the document when you
|
||||||
|
open the document, append the line and column number to the file name in
|
||||||
|
the locator, separated by plus signs (+) or colons (:).
|
||||||
|
|
||||||
|
For example, to open \e HelloWorld.qml to line
|
||||||
|
41 and column 2, enter:
|
||||||
|
|
||||||
|
\code
|
||||||
|
HelloWorld.qml:41:2
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\if defined(qtcreator)
|
||||||
|
\section2 Locating Symbols
|
||||||
|
|
||||||
|
For example, to locate symbols matching \c {QGuiApplication}:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Activate the locator.
|
\li Activate the locator.
|
||||||
|
|
||||||
\li Enter a colon (:) followed by a space and the upper case letters in
|
\li Enter a colon (:) followed by a space and the upper case letters in
|
||||||
the symbol name (QDataStream):
|
the symbol name (here, \c {QGuiApplication}):
|
||||||
|
|
||||||
\code
|
\code
|
||||||
: qds
|
: qga
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
The locator lists the results.
|
The locator lists the results.
|
||||||
|
|
||||||
\image qtcreator-locator-example.png "List of files matching the locator filter"
|
\image qtcreator-locator-example.webp "List of files matching the locator filter"
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -197,16 +143,21 @@
|
|||||||
such as \c {Utils::*View}.
|
such as \c {Utils::*View}.
|
||||||
\endif
|
\endif
|
||||||
|
|
||||||
For example, to create a new file and open it in the editor, type \c f
|
\section2 Creating Files from Locator
|
||||||
|
|
||||||
|
To create a new file and open it in the editor, type \c f
|
||||||
followed by \key Space, followed by path and file name, and then press
|
followed by \key Space, followed by path and file name, and then press
|
||||||
\key Enter.
|
\key Enter.
|
||||||
|
|
||||||
You can use the filter that triggers menu commands to open sessions. Enter
|
You can use the filter that triggers menu commands to open
|
||||||
|
\l{Managing Sessions}{sessions}. Enter
|
||||||
\c {t yoursess} or \c {t sess yoursess} to trigger \uicontrol File >
|
\c {t yoursess} or \c {t sess yoursess} to trigger \uicontrol File >
|
||||||
\uicontrol Sessions > \e yoursessionname.
|
\uicontrol Sessions > \e yoursessionname.
|
||||||
|
|
||||||
By default, the following filters are enabled and you do not need to use
|
\section2 Default Filters
|
||||||
their prefixes explicitly:
|
|
||||||
|
By default, you can use the following preset locator filters without a
|
||||||
|
prefix:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
@@ -218,16 +169,11 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\section1 Changing Locator Filters
|
||||||
If locator does not find some files, see \l{Specifying Project Contents}
|
|
||||||
for how to make them known to the locator.
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\section1 Configuring Locator Filters
|
You can change the preset locator filters to match your use case. For
|
||||||
|
example, you can change the filter prefix and restrict the search to
|
||||||
If the default filters do not match your use case, you can check whether you
|
items that match the filter.
|
||||||
can change them. For all filters, you can change the filter prefix and
|
|
||||||
restrict the search to items that match the filter.
|
|
||||||
|
|
||||||
To configure a locator filter:
|
To configure a locator filter:
|
||||||
|
|
||||||
@@ -266,11 +212,11 @@
|
|||||||
|
|
||||||
\li Select \uicontrol Edit > \uicontrol Preferences >
|
\li Select \uicontrol Edit > \uicontrol Preferences >
|
||||||
\uicontrol Environment > \uicontrol Locator >
|
\uicontrol Environment > \uicontrol Locator >
|
||||||
\uicontrol {Web Search (prefix: r)} > \uicontrol Edit.
|
\uicontrol {Web Search} > \uicontrol Edit.
|
||||||
|
|
||||||
\li Select \uicontrol Add to add a new entry to the list.
|
\li Select \uicontrol Add to add a new entry to the list.
|
||||||
|
|
||||||
\image qtcreator-add-online-doc.png "List of URLs in Filter Configuration dialog"
|
\image qtcreator-add-online-doc.webp "List of URLs in Filter Configuration dialog"
|
||||||
|
|
||||||
\li Double-click the new entry to specify a URL and a search command.
|
\li Double-click the new entry to specify a URL and a search command.
|
||||||
For example, \c {http://www.google.com/search?q=%1}.
|
For example, \c {http://www.google.com/search?q=%1}.
|
||||||
@@ -281,7 +227,7 @@
|
|||||||
|
|
||||||
\section1 Creating Locator Filters
|
\section1 Creating Locator Filters
|
||||||
|
|
||||||
You can create custom locator filters for finding in a directory structure
|
You can create custom locator filters for searching in a directory structure
|
||||||
or on the web.
|
or on the web.
|
||||||
|
|
||||||
To quickly access files not directly mentioned in your project, you can
|
To quickly access files not directly mentioned in your project, you can
|
||||||
@@ -295,7 +241,7 @@
|
|||||||
\li In the locator, select \uicontrol Options >
|
\li In the locator, select \uicontrol Options >
|
||||||
\uicontrol Configure to open the \uicontrol Locator preferences.
|
\uicontrol Configure to open the \uicontrol Locator preferences.
|
||||||
|
|
||||||
\image qtcreator-locator-customize.png "Locator preferences"
|
\image qtcreator-locator-customize.webp "Locator preferences"
|
||||||
|
|
||||||
\li Select \uicontrol Add > \uicontrol {Files in Directories} to add
|
\li Select \uicontrol Add > \uicontrol {Files in Directories} to add
|
||||||
a directory filter or \uicontrol {URL Template} to add a URL
|
a directory filter or \uicontrol {URL Template} to add a URL
|
||||||
@@ -310,7 +256,7 @@
|
|||||||
|
|
||||||
\li In the \uicontrol {File pattern} field, specify file patterns to
|
\li In the \uicontrol {File pattern} field, specify file patterns to
|
||||||
restrict the search to files that match the pattern.
|
restrict the search to files that match the pattern.
|
||||||
Use a comma separated list. For example, to search for all
|
Separate the patterns with commas. For example, to search for all
|
||||||
\c {.qml} and \c {.ui.qml} files, enter \c{*.qml,*.ui.qml}
|
\c {.qml} and \c {.ui.qml} files, enter \c{*.qml,*.ui.qml}
|
||||||
|
|
||||||
\li In the \uicontrol {Exclusion pattern} field, specify file
|
\li In the \uicontrol {Exclusion pattern} field, specify file
|
||||||
@@ -329,9 +275,9 @@
|
|||||||
\section1 Configuring Locator Cache
|
\section1 Configuring Locator Cache
|
||||||
|
|
||||||
The locator searches the files matching your file pattern in the directories
|
The locator searches the files matching your file pattern in the directories
|
||||||
you have selected and caches that information. The cache for all default
|
you have selected and caches that information. \QC updates the cache for all
|
||||||
filters is updated as you write your code. By default, \QC updates the
|
preset filters as you write code. By default, \QC updates your custom
|
||||||
filters created by you once an hour.
|
filters once an hour.
|
||||||
|
|
||||||
To update the cached information manually, select \uicontrol Options >
|
To update the cached information manually, select \uicontrol Options >
|
||||||
\uicontrol Refresh in the locator.
|
\uicontrol Refresh in the locator.
|
||||||
@@ -349,8 +295,7 @@
|
|||||||
|
|
||||||
\section1 Executing JavaScript
|
\section1 Executing JavaScript
|
||||||
|
|
||||||
The locator has a JavaScript interpreter that you can use to
|
The locator has a JavaScript interpreter for performing calculations.
|
||||||
perform calculations.
|
|
||||||
|
|
||||||
Beside simple mathematical operations, like ((1 + 2) * 3), the following
|
Beside simple mathematical operations, like ((1 + 2) * 3), the following
|
||||||
built-in functions exist:
|
built-in functions exist:
|
||||||
|