- Qt Creator Manual
- How To
- Qt Creator Manual 13.0.0

Tutorials ◦ Reference

# How To

The following topics describe how to use Qt Creator to perform a particular task.

## Analyze

Use integrated code analysis tools to detect memory leaks, profile function execution, analyze CPU use, and eliminate unnecessary complexity of code. Other integrated tools provide code coverage and visualize trace events.

- Prevent code erosion
- Analyze code with Clang-Tidy and Clazy
- Configure Clang diagnostics
- Profile CMake code
- Create compiler explorer sessions
- Explore compiler code
- Specify Valgrind settings for a project

## Build and Run

Use integrated cross-platform systems for build automation to compile your source code for different target platforms or with different compilers, debuggers, or Qt versions. Deploy applications to the target platforms and run them there.

- Use compilation databases
- Edit vcpkg manifest files
- Add custom output parsers
- Activate custom output parsers
- Edit Qbs profiles
- Build for many platforms
- Customize the build process
- Configure projects for building
- Enable debugging

### Build with CMake

CMake controls the software compilation process by using simple configuration files, called CMakeLists.txt files.

- Debug CMake project files
- Profile CMake code
- View CMake project contents
- Read CMake documentation
- Add CMake tools
- Edit CMake configuration files
- Complete CMake code
- Format CMake files
- Manage files in CMake projects
- Add libraries to CMake projects

### Build with qmake

qmake automates the generation of Makefiles based on the information in a project file that has the extension .pro.

- Run qmake before building
- Add libraries to qmake projects

### Run applications

Run applications on local and remote desktop systems, as well as on embedded and mobile devices that you connect to the computer.

- Run in Qt Application Manager
- Run on remote Linux devices
- Configure projects for running
- Specify a custom executable to run
- Run on many platforms
- Run Python applications
- Run on QNX devices

## Create Models and Diagrams

Create Universal Modeling Language (UML) style models with structured and behavioral diagrams that offer different views to your system. Or, use a file wizard to create State Chart XML (SCXML) files with boilerplate code and edit them with an SCXML editor.

- Create UML-style models
- Create package diagrams
- Create class diagrams
- Create component diagrams
- Create state charts

## Debug

Use native debuggers to inspect the state of your application while debugging.

- Debug CMake project files

## Design UIs

Design UIs with either Qt Quick or Qt Widgets. Qt Creator integrates a visual editor, Qt Designer, for designing widget-based UIs in the Design mode. For Qt Quick UIs, use a separate visual editor, Qt Design Studio, or the Edit mode.

- Run QML files
- View images
- Create pixmaps from SVG images

## Edit Code

The code editor offers useful features for editing C++ and QML code, such as semantic highlighting, checking code syntax, code completion, and quick fixes. Some of these features are also for other programming languages, such as Python, for which a language server is available that provides information about the code to IDEs.

- Complete code
- Indent text or code
- Check code syntax
- Automatically format QML/JS files
- Paste and fetch code snippets
- Move between files
- Move to symbols
- Insert multiple cursors
- Split the editor view
- Bookmark code
- Parse files
- Inspect the code model
- Use GitHub Copilot
- Compare files
- Edit Markdown files
- Record text editing macros
- Apply quick fixes
- Download highlight definitions
- Highlight code blocks
- Document code
- Switch to Edit mode
- Locate files using the keyboard
- Perform calculations
- Move in QML code
- Paste text from clipboard history
- Enclose code in brackets or quotes
- Select the current code block
- Write down notes
- Edit properties of QML types

### Configure Editors

Configure the code and text editor to suit your specific needs by changing the fonts, colors, highlighting, and indentation.

- Add code snippets to the auto-complete menu
- Change editor colors
- Beautify source code
- Change text encoding
- Select line ending style
- Edit like in Vim
- Edit MIME types
- Specify code style

### Manage Language Servers

Configure language servers that Qt Creator adds by default or add more of them.

- Add generic language servers
- Add a Java language server
- Configure Python language servers
- Turn on QML Language Server
- Inspect language clients
- Configure language server workspace

### Search

Use the incremental and advanced search to search in currently open projects or files on the file system or use the locator to browse through projects, files, classes, functions, documentation, and file systems.

- Rename symbols
- Find symbols
- Navigate with locator
- Search in current file
- Search in projects or file systems
- Turn on Silver Searcher
- Search and replace using a regular expression

## Manage Kits

Qt Creator groups build and run specific settings as kits to make cross-platform development easier. Each kit consists of a set of values that define one environment, such as a device, tool chain, Qt version, and debugger command to use.

- Add compilers
- Add custom compilers
- Add debuggers
- Add kits
- Add Nim compilers
- Add Qt versions

## Manage Projects

Create projects for developing applications and libraries. Then configure the projects for building and running the applications on target platforms.

- Add libraries to CMake projects
- Create vcpkg manifest files
- Import an existing project
- Configure projects for building
- Specify the environment for projects
- Edit environment settings
- Enable debugging
- Configure projects for running
- Use Qt Creator variables
- Develop Qt for Python applications
- Run Python applications

### Create Projects

Use preset wizards to create projects or add custom wizards. You can also import projects from version control systems.

- Add wizards
- Select the build system
- Use project wizards
- Add subprojects to projects
- Add libraries to qmake projects
- Create Nimble projects
- Create Qt Quick Applications
- Create Qt Quick UI Prototypes
- Create VCS repositories for new projects

### Add Files

Add files to projects.

- Add a license header template for C++ code
- Create files
- Create C++ classes
- Set C++ file naming preferences
- Create resource files
- Create OpenGL fragment and vertex shaders
- Add translation files

### Configure Projects

Change the default configurations that installation programs and project wizards create.

- Link projects to Axivion dashboards
- Specify Clang tools settings
- Specify clangd settings
- Specify settings for quick fixes
- Configure language server workspace
- Specify project contents
- Open projects
- Specify dependencies
- Specify editor settings
- Activate kits for a project
- Share project settings
- Exclude files from to-do lists
- Link projects with GitLab

## Read Documentation

Qt Creator integrates the reference documentation for the Qt versions that you install. You can add documentation from other sources.

- Read CMake documentation
- Get help
- Find information in Qt documentation
- Add bookmarks to help pages
- Search from documentation
- Add external documentation
- Detach the help window
- Select the help start page
- Filter documentation

## Test

Create and run code based tests and build system based tests. Code based testing offers special handling for particular testing frameworks that strongly ties to the underlying code models or specialized parsers. Build system based testing is independent from any testing frameworks. It retrieves information directly from the underlying build system and uses it or even the build system as such to execute the respective tests.

- Create Qt tests
- Create Qt Quick tests
- Create Google tests
- Create Boost tests
- Create Catch2 tests
- Create CTest Based Tests
- Add tests to existing test projects
- Build and run tests

## Use Qt Creator

Use basic Qt Creator features and preinstalled plugins. Install more plugins and configure external tools for use.

- Use external tools
- Use Qt Linguist
- Use external text editors
- Contact Qt
- Enable and disable plugins
- Find settings files
- Install plugins
- Install Qt Creator
- Record screens
- Run Qt Creator from the command line
- Inspect internal logs
- Manage sessions
- Manage data collection
- Collect usage statistics
- Set up version control systems
- Use common VCS functions

## Use the UI

Navigate the UI or change its appearance and behavior.

- Find preferences
- Set high DPI scaling
- Switch UI themes
- Assign keyboard shortcuts
- Find keyboard shortcuts
- Set the number of recent files shown
- Show task list files in issues
- View output
- Detach views
- Show and hide the main menu
- Show and hide sidebars
- Switch between modes