ハウツー
以下のトピックでは、Qt Creator を使用して特定のタスクを実行する方法について説明します。
解析
統合コード解析ツールを使用して、メモリ・リークの検出、関数実行のプロファイリング、CPU 使用率の解析、コードの不要な複雑さの除去を行います。その他の統合ツールは、コード・カバレッジを提供し、トレース・イベントを視覚化します。
- Analyze CPU usage
- Analyze code with Clang-Tidy and Clazy
- Check code syntax
- Configure Clang diagnostics
- Create compiler explorer sessions
- Detect errors in C++ code with Cppcheck
- Detect memory leaks with Heob
- Detect memory leaks with Memcheck
- Explore compiler code
- Local analysis with Axivion
- Profile CMake code
- Profile QML applications
- Profile function execution
- Run Valgrind tools on external applications
- Set up code coverage from Coco
- Specify Valgrind settings for a project
- View Axivion static code analysis results
- View code coverage reports from Coco
ビルドと実行
ビルド自動化のための統合されたクロスプラットフォームシステムを使用して、異なるターゲットプラットフォームや異なるコンパイラ、デバッガ、Qt バージョン用にソースコードをコンパイルします。アプリケーションをターゲット プラットフォームにデプロイし、そこで実行します。
- Activate custom output parsers
- Add custom output parsers
- Build for many platforms
- Configure development tools
- Configure projects for building
- Customize the build process
- Edit Qbs profiles
- Edit vcpkg manifest files
- Enable debugging
- Parse build output
- Set the default build and run directories
- Use compilation databases
CMakeでビルドする
CMakeは、CMakeLists.txt ファイルと呼ばれるシンプルな設定ファイルを使用して、ソフトウェアのコンパイルプロセスを制御します。
- Add CMake tools
- Add libraries to CMake projects
- Complete CMake code
- Debug CMake project files
- Edit CMake configuration files
- Format CMake files
- Manage files in CMake projects
- Override CMake settings for a project
- Profile CMake code
- Read CMake documentation
- View CMake project contents
qmake によるビルド
qmake は、.pro という拡張子を持つプロジェクトファイルの情報に基づいて Makefile を自動生成します。
アプリケーションの実行
ローカルおよびリモートのデスクトップシステムだけでなく、コンピュータに接続する組み込みデバイスやモバイルデバイス上でアプリケーションを実行します。
- Configure projects for running
- Run Python applications
- Run in Qt Application Manager
- Run on many platforms
- Set the default build and run directories
- Specify a custom executable to run
モデルとダイアグラムの作成
システムのさまざまなビューを提供する構造化図と動作図を使用して、ユニバーサルモデリング言語(UML)スタイルのモデルを作成します。また、ファイルウィザードを使用して、ボイラープレートコードを含むステートチャートXML(SCXML)ファイルを作成し、SCXMLエディタで編集することもできます。
- Create UML-style models
- Create class diagrams
- Create component diagrams
- Create package diagrams
- Create state charts
デバッグ
デバッガを使用して、アプリケーションの実行中の状態を検査します。
- Add breakpoints
- Attach the debugger to running applications
- Attach the debugger to starting processes
- Debug C++ applications on VxWorks devices
- Debug CMake project files
- Debug crashed processes on Windows
- Debug on Android devices
- Debug remotely with CDB
- Debug remotely with GDB
- Examine complex values in Debug views
- Inspect basic Qt objects
- Load core files to the debugger
- Manage breakpoints
- Set data breakpoints
- Show tooltips for simple values
- Start and debug an external application
- Start debugging
- Start debugging from the command line
- Step through code
UIのデザイン
Qt Quick Qt Widgets Qt Creator には、 モードでウィジェットベースの UI をデザインするためのビジュアルエディタ、 Designer が統合されています。 UIについては、別のビジュアルエディタを使用してください、Design Qt Widgets Qt Quick Qt Design StudioまたはEdit モードを使用してください。
- Create pixmaps from SVG images
- Preview Qt Quick UIs on devices
- Preview a QML file on desktop
- Run QML files
- View images
デバイス向けの開発
ターゲットとする組み込みプラットフォームまたはモバイルプラットフォーム用のアプリケーションをビルドするためのツールチェーンをコンピュータにインストールし、Qt Online Installer を使用してプラットフォーム用にビルドされた Qt ライブラリをインストールします。次に、ツールチェーンとデバイスのアーキテクチャに対応した Qt バージョンを含むキットを追加します。可能であれば、Qt Online Installer が適切なキットを作成してくれます。デバイスをコンピュータに接続して、デバイス上でアプリケーションを実行、デバッグ、分析します。
Android
Qt for Androidと Android ツールをインストールし、Android デバイスをコンピュータに接続します。
- Create an Android Virtual Device (AVD)
- Debug on Android devices
- Manage AVDs
- Manage Android NDK packages
- Manage Android SDK packages
- Set up Android development environment
Bare Metal
GDBまたはハードウェア・デバッガを使用して、リモートLinuxデバイス・プラグインでサポートされていない小型Linuxデバイス上でアプリケーションを実行し、デバッグする。
- Add Bare Metal devices
- Set up EBlink
- Set up J-Link
- Set up OpenOCD
- Set up St-Link
- Set up the uVision IDE
Boot to Qt
デバイス上のアプリケーションの実行、デバッグ、分析 Boot to Qtデバイス上でアプリケーションを実行し、デバッグし、分析する。
ドッカー
Dockerイメージから Dockerデバイスを作成し、アプリケーションのビルド、実行、デバッグに使用します。
- Add Docker devices
- Build for and run on Docker devices
- Build on Docker devices
- Configure development tools
- Set preferences for Docker devices
iOS
Qt for iOSとXcodeをインストールし、iOSデバイスをコンピュータに接続します。
マイコン
インストール Qt for MCUsマイコンをインストールし、コンピュータに接続します。
QNX Neutrino
Qt for QNX をインストールし、QNX Neutrino デバイスをコンピュータに接続します。
- Add a QNX Neutrino device
- Create kits for QNX Neutrino devices
- Debug remotely with GDB
- Run on QNX devices
リモートLinux
汎用のLinuxデバイス用のアプリケーションを構築するためのツールチェーン用のキットを追加し、デバイスをコンピュータに接続する。
- Add remote Linux devices
- Build applications on remote Linux devices
- Configure SSH connections
- Configure development tools
- Connect remote Linux devices
- Debug remotely with GDB
- Generate SSH keys
- Manage device processes
- Run on remote Linux devices
SDK
さまざまなプラットフォーム向けのアプリケーション開発用SDKを管理します。
- Add MCU SDKs
- Create kits for QNX Neutrino devices
- Manage Android NDK packages
- Manage Android SDK packages
- Manage Windows App SDK packages
VxWorks
VxWorks 用 Qt をビルドし、VxWorks ビルド・実行キットを作成します。
WebAssembly
Qt for WebAssembly をインストールすると、Web 用のアプリケーションをビルドして Web ブラウザで実行できます。
コードの編集
コードエディターには、セマンティックハイライト、コード構文のチェック、コード補完、クイックフィックスなど、C++やQMLのコードを編集する際に便利な機能が用意されています。これらの機能の一部はPythonのような他のプログラミング言語にも対応しており、IDEにコードに関する情報を提供する言語サーバーが利用できます。
- Apply quick fixes
- Automatically format QML/JS files
- Bookmark code
- Compare files
- Complete code
- Create Lua scripts
- Document code
- Download highlight definitions
- Edit Markdown files
- Edit properties of QML types
- Enclose code in brackets or quotes
- Highlight code blocks
- Indent text or code
- Insert multiple cursors
- Inspect the code model
- Locate files using the keyboard
- Move between files
- Move in QML code
- Move to symbols
- Parse files
- Paste and fetch code snippets
- Paste text from clipboard history
- Perform calculations
- Record text editing macros
- Select the current code block
- Specify Qt Quick code style
- Split the editor view
- Switch to Edit mode
- Use GitHub Copilot
- Use Qt AI Assistant
- Write down notes
エディタの設定
フォント、色、ハイライト、インデントを変更することで、特定のニーズに合わせてコードエディタとテキストエディタを設定できます。
- Add code snippets to the auto-complete menu
- Beautify source code
- Change editor colors
- Change text encoding
- Configure C++ code model
- Edit MIME types
- Edit like in Vim
- Select line ending style
- Specify code style
言語サーバーの管理
Qt Creator がデフォルトで追加する言語サーバーを設定したり、追加したりします。
- Add a Java language server
- Add generic language servers
- Configure Python language servers
- Configure QML Language Server
- Configure language servers for projects
- Inspect language clients
検索
インクリメンタルサーチとアドバンスサーチを使って、現在開いているプロジェクトやファイルシステム上のファイルを検索したり、ロケーターを使ってプロジェクト、ファイル、クラス、関数、ドキュメント、ファイルシステムをブラウズすることができます。
- Find symbols
- Navigate with locator
- Rename symbols
- Search and replace using a regular expression
- Search in current file
- Search in projects or file systems
- Turn on Silver Searcher
キットの管理
Qt Creator グループは、クロスプラットフォーム開発を容易にするために、特定の設定をキットとしてビルドおよび実行します。各キットは、デバイス、ツールチェーン、Qt バージョン、使用するデバッガコマンドなど、1 つの環境を定義する値のセットで構成されます。
- Activate kits for a project
- Add Bare Metal devices
- Add CMake tools
- Add Nim compilers
- Add Qt versions
- Add compilers
- Add custom compilers
- Add debuggers
- Add kits
- Create kits for QNX Neutrino devices
- Manage MCU kits
- Open projects
プロジェクトの管理
アプリケーションやライブラリを開発するためのプロジェクトを作成します。そして、ターゲット・プラットフォーム上でアプリケーションをビルドして実行するためのプロジェクトを設定します。
- Add libraries to CMake projects
- Configure projects for building
- Configure projects for running
- Create vcpkg manifest files
- Develop Qt for Python applications
- Edit environment settings
- Enable debugging
- Import an existing project
- Open projects
- Run Python applications
- Set the default build and run directories
- Specify the environment for projects
- Use Qt Creator variables
プロジェクトの作成
プリセットのウィザードを使用してプロジェクトを作成するか、カスタムウィザードを追加します。バージョン管理システムからプロジェクトをインポートすることもできます。
- Add libraries to qmake projects
- Add subprojects to projects
- Add wizards
- Create Nimble projects
- Create Qt Interface Framework projects
- Create Qt Quick Applications
- Create Qt Quick UI Prototypes
- Create VCS repositories for new projects
- Select the build system
- Use project wizards
ファイルの追加
プロジェクトにファイルを追加します。
- Add a license header template for C++ code
- Add translation files
- Add wizards
- Create C++ classes
- Create OpenGL fragment and vertex shaders
- Create files
- Create resource files
- Set C++ file naming preferences
プロジェクトの設定
インストールプログラムやプロジェクトウィザードが作成するデフォルトの設定を変更します。
- Activate kits for a project
- Apply filters before scanning for tests
- Configure C++ code model
- Configure language servers for projects
- Create VCS repositories for new projects
- Exclude files from to-do lists
- Link projects with GitLab
- Open projects
- Override CMake settings for a project
- Share project settings
- Specify Clang tools settings
- Specify build and run settings
- Specify clangd settings
- Specify dependencies
- Specify editor settings
- Specify project contents
- Specify settings for quick fixes
ドキュメントを読む
Qt Creator は、インストールした Qt バージョンのリファレンス・ドキュメントを統合します。他のソースからのドキュメントを追加することもできます。
- Add bookmarks to help pages
- Add external documentation
- Detach the help window
- Filter documentation
- Find information in Qt documentation
- Get help
- Read CMake documentation
- Search from documentation
- Select the help start page
テスト
コードベースのテストを作成・実行し、システムベースのテストを構築します。コードベースのテストは、基礎となるコードモデルや特殊なパーサーと強く結びついた、特定のテストフレームワークのための特別な処理を提供します。ビルドシステムベースのテストは、どのテストフレームワークからも独立しています。基礎となるビルドシステムから直接情報を取得し、それを使用するか、あるいはビルドシステムを使用して、それぞれのテストを実行します。
- Add tests to existing test projects
- Apply filters before scanning for tests
- Build and run tests
- Connect to Squish Server
- Create Boost tests
- Create CTest Based Tests
- Create Catch2 tests
- Create Google tests
- Create Qt Quick tests
- Create Qt tests
- Create Squish test suites
- Manage Squish test suites and cases
- Select Squish AUTs
Gitを使う
Gitは高速な分散型バージョン管理システムで、Windows、Linux、macOSで利用できます。Gitを使うプロジェクトでは、Gerritコード・レビュー・ツールを使うことができます。
- Commit your first change
- Create VCS repositories for new projects
- Git Tools
- Initialize Git repositories
- Set up version control systems
- Use Git for Windows
- Use Git with Subversion
- Use common VCS functions
現在のファイル
現在のプロジェクト
ローカル・リポジトリ
- Create and apply patches
- Interactive rebase
- git am
- git branch
- git clean
- git commit
- git diff
- git log
- git merge
- git reflog
- git reset
- git stash
- git status
コミット
リモート・レポジトリ
使用方法Qt Creator
Qt Creator の基本機能とプリインストールされているプラグインを使用します。より多くのプラグインをインストールし、使用する外部ツールを設定します。
- Activate extensions
- Collect usage statistics
- Contact Qt
- Enable and disable plugins
- Inspect internal logs
- Install extensions
- Install plugins
- Manage extensions
- Manage sessions
- Record screens
- Reset Qt Creator settings
- Run Qt Creator from the command line
- Set up version control systems
- Turn on crash reports
- Use Qt Linguist
- Use common VCS functions
- Use external text editors
- Use external tools
UIを使用する
UIをナビゲートしたり、外観や動作を変更する。
- Assign keyboard shortcuts
- Change the UI language
- Detach views
- Find keyboard shortcuts
- Find preferences
- Set high DPI scaling
- Set the number of recent files shown
- Show and hide sidebars
- Show and hide the main menu
- Show task list files in issues
- Switch UI themes
- Switch between modes
- Use info bars instead of pop-ups
- View output
Copyright © The Qt Company Ltd. and other contributors. 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.