2018-08-22 15:45:57 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2019-03-15 11:05:13 +01:00
|
|
|
** Copyright (C) 2019 The Qt Company Ltd.
|
2018-08-22 15:45:57 +02:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of the Qt Creator documentation.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU Free Documentation License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file included in the packaging of
|
|
|
|
|
** this file. Please review the following information to ensure
|
|
|
|
|
** the GNU Free Documentation License version 1.3 requirements
|
|
|
|
|
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*!
|
2019-04-12 16:51:44 +02:00
|
|
|
\contentspage index.html
|
|
|
|
|
\page creator-sidebar-views.html
|
|
|
|
|
\previouspage creator-modes.html
|
|
|
|
|
\nextpage creator-output-panes.html
|
2018-08-22 15:45:57 +02:00
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\title Browsing Project Contents
|
2018-08-22 15:45:57 +02:00
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
A left and right sidebar are available in most \QC \l{Selecting Modes}
|
|
|
|
|
{modes}. The availability of the sidebars and their contents depend on
|
|
|
|
|
the mode.
|
2018-08-22 15:45:57 +02:00
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
In the \uicontrol Edit and \uicontrol Design mode, you can use the sidebars
|
|
|
|
|
to browse the project contents.
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
\image qtcreator-sidebar.png
|
|
|
|
|
|
|
|
|
|
You can select the contents of the sidebars in the sidebar menu (1):
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li \uicontrol Projects shows a list of projects open in the current
|
|
|
|
|
session and the project files needed by the build system.
|
|
|
|
|
\li \uicontrol{Open Documents} shows currently open files.
|
|
|
|
|
\if defined(qtcreator)
|
|
|
|
|
\li \uicontrol Bookmarks shows all bookmarks for the current session.
|
|
|
|
|
\endif
|
|
|
|
|
\li \uicontrol{File System} shows all files in the currently selected
|
|
|
|
|
directory.
|
2018-09-14 11:05:16 +02:00
|
|
|
\li \uicontrol {Git Branches} shows the local and remote brances for the
|
|
|
|
|
project in the Git version control system. For more information, see
|
|
|
|
|
\l{Working with Branches}.
|
2018-08-22 15:45:57 +02:00
|
|
|
\li \uicontrol Outline shows an overview of defined types and other
|
|
|
|
|
symbols, as well as their properties and hierarchy in a source file.
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
\if defined(qtcreator)
|
|
|
|
|
The following views display additional information about C++ code:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li \uicontrol {Class View} shows the class hierarchy of the currently
|
|
|
|
|
open projects.
|
|
|
|
|
\li \uicontrol Tests lists autotests and Qt Quick tests in the project.
|
|
|
|
|
For more information, see \l {Running Autotests}.
|
|
|
|
|
\li \uicontrol {Type Hierarchy} shows the base classes of a class.
|
|
|
|
|
\li \uicontrol {Include Hierarchy} shows which files are included in
|
|
|
|
|
the current file and which files include the current file.
|
|
|
|
|
\endlist
|
|
|
|
|
\endif
|
|
|
|
|
|
|
|
|
|
For more information about the sidebar views that are only
|
|
|
|
|
available when editing QML files in the Design mode, see
|
|
|
|
|
\l{Editing QML Files in Design Mode}.
|
|
|
|
|
|
|
|
|
|
You can change the view of the sidebars in the following ways:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
|
|
|
|
\li To toggle the left sidebar, click \inlineimage leftsidebaricon.png
|
|
|
|
|
(\uicontrol {Hide Left Sidebar/Show Left Sidebar}) or press
|
|
|
|
|
\key Alt+0 (\key Cmd+0 on \macos). To toggle the right
|
|
|
|
|
sidebar, click \inlineimage rightsidebaricon.png
|
|
|
|
|
(\uicontrol {Hide Right Sidebar/Show Right Sidebar}) or press
|
|
|
|
|
\key Alt+Shift+0 (\key Cmd+Shift+0 on \macos).
|
|
|
|
|
|
|
|
|
|
\li To split a sidebar, click \inlineimage splitbutton_horizontal.png
|
|
|
|
|
(\uicontrol {Split}). Select new content to view in the split view.
|
|
|
|
|
|
|
|
|
|
\li To close a sidebar view, click \inlineimage splitbutton_closetop.png
|
|
|
|
|
(\uicontrol {Close}).
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
The additional options in each view are described in the following
|
|
|
|
|
sections.
|
|
|
|
|
|
|
|
|
|
In some views, right-clicking opens a context menu that contains functions
|
|
|
|
|
for managing the objects listed in the view.
|
|
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\section1 Viewing Project Files
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
The sidebar displays projects in a project tree. The project tree contains
|
|
|
|
|
a list of all projects open in the current session. For each project, the
|
|
|
|
|
tree visualizes the build system structure of the project and lists all
|
|
|
|
|
files that are part of the project.
|
|
|
|
|
|
|
|
|
|
\if defined(qtcreator)
|
|
|
|
|
Some build systems support adding and removing files to a project in \QC
|
|
|
|
|
(currently qmake and Qbs). The faithful display of the project structure
|
|
|
|
|
allows to specify exactly where a new file should be placed in the build
|
|
|
|
|
system.
|
|
|
|
|
\endif
|
|
|
|
|
|
|
|
|
|
\if defined(qtcreator)
|
|
|
|
|
If the project is under version control, information from the version
|
|
|
|
|
control system might be displayed in brackets after the project name.
|
|
|
|
|
This is currently implemented for Git (the branch name or a tag is
|
|
|
|
|
displayed) and ClearCase (the view name is displayed).
|
|
|
|
|
\else
|
|
|
|
|
If the project is under Git version control, the currently checked out
|
|
|
|
|
branch or tag is displayed in brackets after the project name.
|
|
|
|
|
\endif
|
|
|
|
|
|
|
|
|
|
You can use the project tree in the following ways:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
|
|
|
|
\li To open files that belong to a project, double-click them in the
|
|
|
|
|
project tree. Files open in the appropriate editor, according to the
|
2018-08-30 12:36:23 +02:00
|
|
|
file type. For example, code source files open in the code editor.
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
\li To bring up a context menu containing the actions most commonly
|
|
|
|
|
needed, right-click an item in the project tree. For example,
|
|
|
|
|
through the menu of the project root directory you can, among
|
|
|
|
|
other actions, run and close the project.
|
|
|
|
|
|
|
|
|
|
\li To hide the categories and sort project files alphabetically, click
|
|
|
|
|
\inlineimage filtericon.png
|
|
|
|
|
(\uicontrol {Filter Tree}) and select \uicontrol{Simplify Tree}.
|
|
|
|
|
|
|
|
|
|
\li To hide source files which are automatically generated by the build
|
|
|
|
|
system, select \uicontrol {Filter Tree > Hide Generated Files}.
|
|
|
|
|
|
2019-04-02 14:48:03 +02:00
|
|
|
\li To hide directories that do not contain any files, select
|
|
|
|
|
\uicontrol {Filter Tree} > \uicontrol {Hide Empty Directories}.
|
|
|
|
|
|
2018-08-22 15:45:57 +02:00
|
|
|
\li To stop synchronizing the position in the project tree with the file
|
|
|
|
|
currently opened in the editor, deselect \inlineimage linkicon.png
|
|
|
|
|
(\uicontrol {Synchronize with Editor}). You can specify a keyboard
|
|
|
|
|
shortcut to use when synchronization is needed. Select
|
|
|
|
|
\uicontrol Tools > \uicontrol Options > \uicontrol Environment >
|
|
|
|
|
\uicontrol Keyboard, and then search for
|
|
|
|
|
\uicontrol {Show in Explorer}.
|
|
|
|
|
|
|
|
|
|
\li To see the absolute path of a file, move the mouse pointer over the
|
|
|
|
|
file name.
|
|
|
|
|
|
2019-06-05 15:53:11 +02:00
|
|
|
\li To move files from one project to another, drag-and-drop them
|
|
|
|
|
in the project tree. \QC makes the necessary changes to project
|
|
|
|
|
configuration files.
|
|
|
|
|
|
2018-08-22 15:45:57 +02:00
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
\if defined(qtcreator)
|
|
|
|
|
Files that are not sources or data can be still included into a project's
|
|
|
|
|
distribution tarball by adding their paths to the \c DISTFILES variable in
|
|
|
|
|
the .pro file. This way they also become known to \QC, so that they are
|
|
|
|
|
visible in the \uicontrol Projects view and are known to the locator and
|
|
|
|
|
search.
|
|
|
|
|
\endif
|
|
|
|
|
|
|
|
|
|
The \uicontrol Projects view contains context menus for managing projects,
|
|
|
|
|
subprojects, folders, and files. The following functions are available for
|
|
|
|
|
managing projects and subprojects:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li Set a project as the active project.
|
|
|
|
|
\li Execute the \uicontrol Build menu commands.
|
|
|
|
|
\li Create new files. For more information, see
|
|
|
|
|
\l{Adding Files to Projects}.
|
2019-09-23 16:31:15 +02:00
|
|
|
\li Rename or remove existing files. If you change the base name of a
|
|
|
|
|
file, \QC displays a list of other files with the same base name
|
|
|
|
|
and offers to rename them as well.
|
2018-08-22 15:45:57 +02:00
|
|
|
\if defined(qtcreator)
|
2019-09-27 16:34:40 +02:00
|
|
|
\li Remove existing directories from \l{Setting Up a Generic Project}
|
|
|
|
|
{generic projects}.
|
2018-08-22 15:45:57 +02:00
|
|
|
\li Add existing files and directories.
|
|
|
|
|
\li Add libraries. For more information, see
|
|
|
|
|
\l{Adding Libraries to Projects}.
|
|
|
|
|
\li Add and remove subprojects.
|
|
|
|
|
\endif
|
|
|
|
|
\li Search from the selected directory.
|
2019-03-15 16:25:21 +01:00
|
|
|
\li Expand or collapse the tree view to show or hide all files and
|
|
|
|
|
folders.
|
|
|
|
|
\li Close all files in a project.
|
2019-06-06 11:18:48 +02:00
|
|
|
\li Close projects. By default, all files in the project are also
|
|
|
|
|
closed. To keep them open, deselect the \uicontrol Tools >
|
|
|
|
|
\uicontrol Options > \uicontrol {Build & Run} > \uicontrol General
|
|
|
|
|
> \uicontrol {Close source files along with project} check box.
|
2018-08-22 15:45:57 +02:00
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
For managing files and directories, the same functions are available as in
|
2019-09-23 16:31:15 +02:00
|
|
|
the \uicontrol {File System} view.
|
2018-08-22 15:45:57 +02:00
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\section1 Viewing the File System
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
If you cannot see a file in the \uicontrol Projects view, switch to the
|
|
|
|
|
\uicontrol {File System} view, which shows all the files in the file system.
|
|
|
|
|
|
|
|
|
|
\image qtcreator-filesystem-view.png
|
|
|
|
|
|
|
|
|
|
By default, the contents of the directory that contains the file currently
|
|
|
|
|
active in the editor are displayed. To stop the synchronization, delesect
|
|
|
|
|
the \uicontrol {Synchronize Root Directory with Editor} button.
|
|
|
|
|
|
|
|
|
|
The path to the active file is displayed
|
|
|
|
|
as bread crumbs. You can move to any directory along the path by clicking
|
|
|
|
|
it. To hide the bread crumbs, select \inlineimage filtericon.png
|
|
|
|
|
(\uicontrol Options) and then deselect the \uicontrol {Show Bread Crumbs}
|
|
|
|
|
check box.
|
|
|
|
|
|
|
|
|
|
To move to the root directory of the
|
|
|
|
|
file system, select \uicontrol Computer in the menu (1). Select
|
|
|
|
|
\uicontrol Home to move to the user's home directory. Further, you can
|
|
|
|
|
select a project to move to an open project or \uicontrol Projects to open
|
|
|
|
|
the \uicontrol Projects view.
|
|
|
|
|
|
|
|
|
|
By default, folders are separated from files and listed first in the view.
|
|
|
|
|
To list all items in alphabetic order, select \uicontrol Options and then
|
|
|
|
|
deselect the \uicontrol {Show Folders on Top} check box.
|
|
|
|
|
|
|
|
|
|
To also show hidden files, select \uicontrol Options >
|
|
|
|
|
\uicontrol {Show Hidden Files}.
|
|
|
|
|
|
|
|
|
|
To stop the synchronization with the file currently opened in the editor,
|
|
|
|
|
deselect \uicontrol {Synchronize with Editor}.
|
|
|
|
|
|
|
|
|
|
Use the context menu functions to:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
|
|
|
|
\li Open files with the default editor or some other editor.
|
|
|
|
|
|
|
|
|
|
\li Open a project located in the selected directory.
|
|
|
|
|
|
|
|
|
|
\li Show the file or directory in the file explorer.
|
|
|
|
|
|
|
|
|
|
\li Open a terminal window in the selected directory or in the directory
|
2018-10-19 10:37:43 +02:00
|
|
|
that contains the file. To specify the terminal to use on Linux and
|
|
|
|
|
\macos, select \uicontrol Tools > \uicontrol Options >
|
|
|
|
|
\uicontrol Environment > \uicontrol System.
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
\li Search from the selected directory.
|
|
|
|
|
|
|
|
|
|
\li View file properties, such as MIME type, default editor, and size.
|
|
|
|
|
|
|
|
|
|
\li Create new files. For more information, see
|
|
|
|
|
\l{Adding Files to Projects}.
|
|
|
|
|
|
|
|
|
|
\li Rename or remove existing files.
|
|
|
|
|
|
|
|
|
|
\li Create new folders.
|
|
|
|
|
|
|
|
|
|
\li Compare the selected file with the currently open file in the diff
|
|
|
|
|
editor. For more information, see \l{Comparing Files}.
|
|
|
|
|
|
|
|
|
|
\li Display the contents of a particular directory in the view.
|
|
|
|
|
|
|
|
|
|
\li Collapse all open folders.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
2019-06-04 10:54:25 +02:00
|
|
|
\section1 Viewing Open Documents
|
|
|
|
|
|
|
|
|
|
To see a list of open documents, switch to the \uicontrol {Open Documents}
|
|
|
|
|
view. You can use the context-menu to perform some of the functions also
|
|
|
|
|
available in the \uicontrol File menu and in the context menu in the
|
|
|
|
|
\uicontrol {File System} view.
|
|
|
|
|
|
|
|
|
|
In addition, you can:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li Copy the full path of the file or just the filename to the
|
|
|
|
|
clipboard.
|
|
|
|
|
\li Pin files to ensure they stay at the top of the list and are not
|
|
|
|
|
closed when \uicontrol {Close All} is used.
|
|
|
|
|
\endlist
|
|
|
|
|
|
2019-09-17 14:44:13 +02:00
|
|
|
To specify settings for opening files and handling open files, select
|
|
|
|
|
\uicontrol Tools > \uicontrol Options > \uicontrol Environment >
|
|
|
|
|
\uicontrol System:
|
|
|
|
|
|
|
|
|
|
\image qtcreator-options-environment-system.png "Environment options System tab"
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li In the \uicontrol {When files are externally modified} field,
|
|
|
|
|
select whether you want to be prompted to reload open files
|
|
|
|
|
that were modified externally. For example, when you pull
|
|
|
|
|
changes from a version control system.
|
|
|
|
|
\li Select the \uicontrol {Auto-save modified files} check box to
|
|
|
|
|
automatically save changed files at the intervals specified in
|
|
|
|
|
the \uicontrol Interval field.
|
|
|
|
|
\li Select the \uicontrol {Auto-suspend unmodified files} check
|
|
|
|
|
box to automatically free the resources of open files after
|
|
|
|
|
prolonged inactivity. The files are still listed in the
|
|
|
|
|
\uicontrol {Open Documents} view. Set the minimum number of files
|
|
|
|
|
that should be kept in memory in the \uicontrol {Files to keep open}
|
|
|
|
|
field.
|
|
|
|
|
\li Select the \uicontrol {Warn before opening text files greater than}
|
|
|
|
|
check box to receive warnings about opening big text files.
|
|
|
|
|
\li In the \uicontrol {Maximum number of entries in "Recent Files"}
|
|
|
|
|
field, set the number of recently opened files listed in
|
|
|
|
|
\uicontrol File > \uicontrol {Recent Files}.
|
|
|
|
|
\endlist
|
|
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\section1 Viewing Defined Types and Symbols
|
2018-08-22 15:45:57 +02:00
|
|
|
|
2019-03-15 11:05:13 +01:00
|
|
|
The \uicontrol Outline view shows an overview of defined types and other
|
|
|
|
|
symbols, as well as their properties and hierarchy in a source file.
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
\li To see a complete list of all bindings, select
|
|
|
|
|
\uicontrol {Filter Tree} > \uicontrol {Show All Bindings}.
|
2019-03-15 11:05:13 +01:00
|
|
|
\li To stop the synchronization with the type or symbol selected in the
|
2018-08-22 15:45:57 +02:00
|
|
|
editor, deselect \uicontrol {Synchronize with Editor}.
|
|
|
|
|
\endlist
|
|
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\section1 Viewing the Class Hierarchy
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
The \uicontrol {Class View} shows the class hierarchy of the currently
|
|
|
|
|
open projects. To organize the view by subprojects, click
|
|
|
|
|
\inlineimage qtcreator-show-subprojects.png
|
|
|
|
|
(\uicontrol {Show Subprojects}).
|
|
|
|
|
|
|
|
|
|
To visit all parts of a namespace, double-click on the namespace item
|
|
|
|
|
multiple times.
|
|
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\section1 Viewing Type Hierarchy
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
To view the base classes of a class, right-click the class and select
|
|
|
|
|
\uicontrol {Open Type Hierarchy} or press \key {Ctrl+Shift+T}.
|
|
|
|
|
|
2019-04-12 16:51:44 +02:00
|
|
|
\section1 Viewing Include Hierarchy
|
2018-08-22 15:45:57 +02:00
|
|
|
|
|
|
|
|
To view which files are included in the current file and which files include
|
|
|
|
|
the current file, right-click in the editor and select
|
|
|
|
|
\uicontrol {Open Include Hierarchy} or press \key {Ctrl+Shift+I}.
|
|
|
|
|
|
2019-03-20 16:14:42 +01:00
|
|
|
To keep the view synchronized with the file currently opened in the editor,
|
|
|
|
|
select \uicontrol {Synchronize with Editor}.
|
2018-08-22 15:45:57 +02:00
|
|
|
*/
|