Working in Edit Mode

This section describes how to use the Edit mode. For more information about using the sidebar, see Browsing Project Contents.

Using the Editor Toolbar

The editor toolbar is located at the top of the editor view. The editor toolbar is context sensitive and shows items relevant to the file currently open in the editor.

Use the toolbar to navigate between open files and symbols in use. To browse backward or forward through your location history, click (Go Back) and (Go Forward).

To go to any open file, select it from the Open files drop-down menu (1). Right-click the menu title and select Copy Full Path to copy the path and name of the current file to the clipboard.

To jump to any symbol used in the current file, select it from the Symbols drop-down menu (2). By default, the symbols are displayed in the order in which they appear in the file. Right-click the menu title and select Sort Alphabetically to arrange the symbols in alphabetic order.

To jump to a line and column in the current file, select the line and column indicator (3) or press Ctrl+L (or Cmd+L on macOS) to open the locator. Enter the line number and column number in the locator, separated by a colon (:).

Note: Other convenient ways of navigating in Qt Design Studio are provided by the locator, keyboard shortcuts, and the sidebar.

Splitting the Editor View

Split the editor view or open the editor in a new window when you want to work on and view multiple files on the same screen or on multiple screens.

You can view multiple files simultaneously in the following ways:

  • To split the editor view into a top and bottom view, select Window > Split, press Ctrl+E, 2, or select the (Split) button and then select Split.

    Split command creates views below the currently active editor view.

  • To split the editor view into adjacent views, select Window > Split Side by Side, press Ctrl+E, 3, or select Split > Split Side by Side.

    Side by side split command creates views to the right of the currently active editor view.

  • To open the editor in a detached window, press Ctrl+E, 4, or select Window > Open in New Window.

    The new window behaves basically in the same way as the editor area in the main window. For example, you can split this window, as well. Documents are opened in the currently active editor window.

To move between split views and detached editor windows, select Window > Go to Next Split or Window or press Ctrl+E, O.

To remove a split view, place the cursor within the view you want to remove and select Window > Remove Current Split, press Ctrl+E, 0, or select the (Remove Split) button. To remove all but the currently selected split view, select Window > Remove All Splits or press Ctrl+E, 1.

Browsing Project Contents

A left and right sidebar are available in most Qt Design Studio modes. The availability of the sidebars and their contents depend on the mode.

In the Edit mode, you can use the sidebars to browse the project contents.

You can select the contents of the sidebars in the sidebar menu (1):

  • Projects shows a list of projects open in the current session and the project files needed by the build system.
  • Open Documents shows currently open files.
  • File System shows all files in the currently selected directory.
  • Git Branches shows the local and remote brances for the project in the Git version control system. For more information, see Working with Branches.
  • Outline shows an overview of defined types and other symbols, as well as their properties and hierarchy in a source file.

For more information about the sidebar views that are only available when editing QML files in the Design mode, see Editing QML Files in Design Mode.

You can change the view of the sidebars in the following ways:

  • To toggle the left sidebar, click (Hide Left Sidebar/Show Left Sidebar) or press Alt+0 (Cmd+0 on macOS). To toggle the right sidebar, click (Hide Right Sidebar/Show Right Sidebar) or press Alt+Shift+0 (Cmd+Shift+0 on macOS).
  • To split a sidebar, click (Split). Select new content to view in the split view.
  • To close a sidebar view, click (Close).

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.

Viewing Project Files

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 the project is under Git version control, the currently checked out branch or tag is displayed in brackets after the project name. 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.
  • 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.
  • To hide the categories and sort project files alphabetically, click (Filter Tree) and select Simplify Tree.
  • To hide source files which are automatically generated by the build system, select Filter Tree > Hide Generated Files.
  • To stop synchronizing the position in the project tree with the file currently opened in the editor, deselect (Synchronize with Editor). You can specify a keyboard shortcut to use when synchronization is needed. Select Tools > Options > Environment > Keyboard, and then search for Show in Explorer.
  • To see the absolute path of a file, move the mouse pointer over the file name.

The Projects view contains context menus for managing projects, subprojects, folders, and files. The following functions are available for managing projects and subprojects:

  • Set a project as the active project.
  • Execute the Build menu commands.
  • Create new files. For more information, see Adding Files to Projects.
  • Search from the selected directory.
  • Close projects.

For managing files and directories, the same functions are available as in the File System view. In addition, you can remove and rename files.

Viewing the File System

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.

By default, the contents of the directory that contains the file currently active in the editor are displayed. To stop the synchronization, delesect the 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 (Options) and then deselect the Show Bread Crumbs check box.

To move to the root directory of the file system, select Computer in the menu (1). Select Home to move to the user's home directory. Further, you can select a project to move to an open project or Projects to open the Projects view.

By default, folders are separated from files and listed first in the view. To list all items in alphabetic order, select Options and then deselect the Show Folders on Top check box.

To also show hidden files, select Options > Show Hidden Files.

To stop the synchronization with the file currently opened in the editor, deselect Synchronize with Editor.

Use the context menu functions to:

  • Open files with the default editor or some other editor.
  • Open a project located in the selected directory.
  • Show the file or directory in the file explorer.
  • Open a terminal window in the selected directory or in the directory that contains the file. To specify the terminal to use on Linux and macOS, select Tools > Options > Environment > System.
  • Search from the selected directory.
  • View file properties, such as MIME type, default editor, and size.
  • Create new files. For more information, see Adding Files to Projects.
  • Rename or remove existing files.
  • Create new folders.
  • Compare the selected file with the currently open file in the diff editor. For more information, see Comparing Files.
  • Display the contents of a particular directory in the view.
  • Collapse all open folders.

Viewing QML Types

The Outline view shows the type hierarchy in a QML file.

  • To see a complete list of all bindings, select Filter Tree > Show All Bindings.
  • To stop the synchronization with the QML type selected in the editor, deselect Synchronize with Editor.

Available under certain Qt licenses.
Find out more.