Projects

{Projects view in the sidebar}

Note: Usually, searching with the locator is the fastest way to find a particular project, file, class, or function, or almost anything else in your project. You can use the project tree in the following ways:

  • To open files that belong to a project, double-click them in the project tree. Files open in the appropriate editor, according to the file type. For example, code source files open in the code editor. Use the mode selector to open the current file in another editor.
  • To open a context menu that has 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.
  • To see the absolute path of a file, move the mouse pointer over the file name.
  • To move files from one project to another, drag them in the project tree. Qt Creator makes the necessary changes to project configuration files.

Note: If you cannot see a file in the Projects view, switch to the File System view, which shows all the files in the file system.

Projects View Context Menu

The Projects view has context menus for managing projects, subprojects, folders, and files. Use the following functions to manage projects and subprojects:

  • Set a project as the active project.
  • Execute Build menu commands.
  • Create new files. For more information, see Create files.
  • Rename existing files. If you change the base name of a file, Qt Creator displays a list of other files with the same base name and offers to rename them as well. If you rename a UI file (.ui), Qt Creator also changes corresponding include statements accordingly.
  • Remove existing files.
  • Remove existing directories from generic projects.
  • Add existing files and directories.
  • Add libraries. For more information, see Add libraries to qmake projects.
  • Add and remove subprojects.
  • Find unused functions.
  • Search in the selected directory.
  • Open a terminal window in the project directory. To specify the terminal to use on Linux and macOS, select Preferences > Environment > System. To use an internal terminal, select Preferences > Terminal > Use internal terminal.
  • Open a terminal window in the project directory that you configured for building or running the project.
  • Expand or collapse the tree view to show or hide all files and folders.
  • Close all files in a project.
  • Close the selected project or all projects except the selected one. By default, this closes all files in the projects. To keep them open, deselect the Preferences > Build & Run > General > Close source files along with project check box.

For managing files and directories, use the same functions as in the File System view. To view a project in it, select Show in File System View.

Projects View Toolbar

The toolbar in the Projects view has additional options.

To filter view contents, select (Filter Tree):

  • Simplify Tree hides the categories and sorts project files alphabetically.
  • Hide Generated Files hides the source files that the build system automatically generates.
  • Hide Disabled Files hides the source files that you have not enabled for the current target,
  • Hide Empty Directories hides directories that do not have any files.
  • Show Source and Header Groups shows source and header files grouped together in the view, regardless of their location in the file system.

To stop synchronizing the position in the project tree with the file currently opened in the editor, deselect (Synchronize with Editor).

Some build systems support adding and removing files to a project in Qt Creator (currently qmake and Qbs). The faithful display of the project structure enables you to specify exactly where to place a new file in the build system.

If you cannot see some files, you might have to declare them as part of the project. For more information, see Specify project contents.

If the project is under version control, you might see information from the version control system in brackets after the project name. Qt Creator currently implements this for Git (the view displays the branch name or a tag) and ClearCase (the view displays the branch name).

See also View CMake project contents and File System.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.