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.
- Analyze CPU usage
- View Axivion static code analysis results
- Analyze code with Clang-Tidy and Clazy
- Configure Clang diagnostics
- Check code coverage
- Detect errors in C++ code with Cppcheck
- Detect memory leaks with Heob
- Detect memory leaks with Memcheck
- Profile function execution
- Run Valgrind tools on external applications
- Profile CMake code
- Check code syntax
- Create compiler explorer sessions
- Explore compiler code
- Specify Valgrind settings for a project
- Profile QML applications
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
- Override CMake settings for a project
Build with qmake
qmake automates the generation of Makefiles based on the information in a project file that has the extension .pro.
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
- Configure projects for running
- Specify a custom executable to run
- Run on many platforms
- Run Python applications
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 debuggers to inspect the state of your application while it is running.
- Debug CMake project files
- Add breakpoints
- Manage breakpoints
- Set data breakpoints
- Start debugging
- Start and debug an external application
- Attach the debugger to running applications
- Attach the debugger to starting processes
- Load core files to the debugger
- Debug crashed processes on Windows
- Start debugging from the command line
- Debug remotely with GDB
- Debug remotely with CDB
- Show tooltips for simple values
- Examine complex values in Debug views
- Step through code
- Inspect basic Qt objects
Design UIs
Design UIs with either Qt Quick or Qt Widgets. Qt Creator integrates a visual editor, Qt Widgets 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
- Preview UI prototypes in browsers
- Preview a QML file on desktop
- Preview Qt Quick UIs on devices
Develop for Devices
Install the toolchain for building applications for the targeted embedded or mobile platform on the computer, and use Qt Online Installer to install Qt libraries that are built for the platform. Then add a kit with the toolchain and the Qt version for the device's architecture. When possible, Qt Online Installer creates suitable kits for you. Connect the devices to the computer to run, debug, and analyze applications on them.
Android
Install Qt for Android and Android tools, and connect Android devices to the computer.
- Set up Android development environment
- Manage Android NDK packages
- Manage Android SDK packages
- Manage AVDs
- Create an Android Virtual Device (AVD)
- Debug on Android devices
Bare Metal
Run and debug applications on small Linux devices that are not supported by the remote Linux device plugin by using GDB or a hardware debugger.
- Set up EBlink
- Set up J-Link
- Set up OpenOCD
- Set up St-Link
- Set up the uVision IDE
- Add Bare Metal devices
Boot to Qt
Run, debug, and analyze applications on Boot to Qt devices.
Docker
Create Docker devices from Docker images and use them to build, run, and debug applications.
- Add Docker devices
- Set preferences for Docker devices
- Build for and run on Docker devices
- Build on Docker devices
iOS
Install Qt for iOS and Xcode, and connect iOS devices to the computer.
MCUs
Install Qt for MCUs, and connect microcontrollers to the computer.
QNX Neutrino
Install Qt for QNX, and connect QNX Neutrino devices to the computer.
Remote Linux
Add kits for toolchains for building applications for generic Linux devices, and connect the devices to the computer.
- Run on remote Linux devices
- Configure SSH connections
- Generate SSH keys
- Manage device processes
- Connect remote Linux devices
- Add remote Linux devices
- Build applications on remote Linux devices
VxWorks
Build Qt for VxWorks, and create VxWorks build and run kits.
WebAssembly
Install Qt for WebAssembly to build applications for the web and run them in a web browser.
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
- Automatically format QML/JS files
- Use Qt AI Assistant
- 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
- Create Lua scripts
- 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
- Configure C++ code model
- 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
- Configure QML Language Server
- Inspect language clients
- Configure language server workspace
- Turn on or off QML Language Server for a project
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, toolchain, Qt version, and debugger command to use.
- Add Bare Metal devices
- Add CMake tools
- Manage MCU Kits
- Add compilers
- Add custom compilers
- Add debuggers
- Add kits
- Add Nim compilers
- Open projects
- Add Qt versions
- Activate kits for a project
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
- Open projects
- 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 wizards
- Add translation files
Configure Projects
Change the default configurations that installation programs and project wizards create.
- Specify Clang tools settings
- Override CMake settings for a project
- Configure C++ code model
- 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
- Turn on or off QML Language Server for a project
- Share project settings
- Apply filters before scanning for tests
- Exclude files from to-do lists
- Link projects with GitLab
- Create VCS repositories for new projects
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
- Connect to Squish Server
- Select Squish AUTs
- Manage Squish test suites and cases
- Create Squish test suites
- Apply filters before scanning for tests
Use Git
Git is a fast decentralized version control system that is available for Windows, Linux, and macOS. You can use the Gerrit Code Review tool for projects that use Git.
- Use Git for Windows
- Set up version control systems
- Create VCS repositories for new projects
- Use common VCS functions
- Commit your first change
- Initialize Git repositories
- Use Git with Subversion
- Git Tools
Current file
Current project
Local repositories
- git diff
- git log
- git reset
- git clean
- git reflog
- git status
- git commit
- git am
- Interactive rebase
- git branch
- git merge
- Apply patches
- git stash
Commits
Remote repositories
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
- Reset Qt Creator settings
- Manage extensions
- Load extensions
- Install extensions
- Install plugins
- Record screens
- Turn on crash reports
- Run Qt Creator from the command line
- Inspect internal logs
- Collect usage statistics
- Manage sessions
- Set up version control systems
- Use common VCS functions
Use the UI
Navigate the UI or change its appearance and behavior.