Manage sessions

When you exit Qt Creator, it stores a snapshot of your current workspace as a session. To restore the session automatically when you start Qt Creator, select File > Sessions > Manage > Restore last session on startup.

When you open or create any of the following items, they automatically become a part of the session:

  • Projects with their dependencies (including SUBDIRS projects when using qmake)
  • Editors
  • Breakpoints and expressions
  • Bookmarks

A session is personal, that is, not meant to be shared. It is not supposed to reflect the project structure. It contains personal data, such as bookmarks and breakpoints that are usually not of interest to other developers working on the same projects.

For example, if you work on a project and need to switch to another project for a while, you can clone the current session to save it under a name and create a new session for the other project. Everything that you open after switching to the new session becomes a part of it. When you want to return to working on the first project, switch to the saved session. Qt Creator opens the projects and files that belong to the session.

To manage sessions, select File > Sessions > Manage.

{Session Manager}

To save a session under a new name, select Clone.

Create new sessions

To create a new session:

  1. Select New.
  2. In the Enter the name of the session field, enter a name for the session.
  3. Select Create to create a new empty session or Create and Open to create a session and to switch to it.

Open sessions

To switch between sessions:

  • Go to File > Sessions, and select a session.
  • Select Open in Session Manager.

The Projects tab in the Welcome mode lists existing sessions. To open a session, select it or press Ctrl+Alt+<number>, where <number> is the number of the session to open (available for the first nine sessions).

{Sessions in the Welcome mode}

To view more information about a session, select the down arrow icon that appears when you move the mouse cursor over the session name. Select actions to clone, rename, and delete sessions.

When you start Qt Creator from the command line, you can give the name of a session as an argument to start Qt Creator with this session.

Open sessions from the locator

Use the t filter that triggers menu commands to open sessions.

To locate a session:

  1. Press Ctrl+K (Cmd+K on macOS) to activate the locator.
  2. Enter:
    • t <session_name>
    • t sess <session_name>

    where <session_name> is the name of the session to open.

  3. Double-click the session name to open it.

See also Navigate with locator and Command-Line Options.

© 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.