どのように
以下のトピックでは、Qt Creator を使って特定のタスクを実行する方法について説明します。
UIの適応
Qt Creator UI を操作したり、その外観や動作を変更したりします。
UI を適応させる方法
- Assign keyboard shortcuts
- Change the UI language
- Detach views
- Find keyboard shortcuts
- Find preferences
- Import and export keyboard shortcuts
- Preview images
- 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 Squish output
- View application output
- View call hierarchy
- View class hierarchy
- View compile output
- View file system
- View include hierarchy
- View issues
- View open documents
- View outline
- View output
- View projects
- View search results
- View type hierarchy
解析
統合されたコード解析ツールを使用して、メモリ・リークの検出、関数実行のプロファイリング、CPU使用の解析、コードの不要な複雑さの除去を行います。その他の統合ツールは、コード・カバレッジを提供し、トレース・イベントを可視化します。
コードの解析方法
- Analyze CPU usage
- Analyze code with Clang-Tidy and Clazy
- Check code syntax
- Configure Clang diagnostics
- Connect to Axivion dashboard servers
- 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 global preferences for Clang tools
- 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 Qbs profile directory
- Set the default build and run directories
- Set up vcpkg package manager
- Use Development Containers
- Use MCP client
- Use compilation databases
- View compile output
CMakeでビルドする
CMakeは、CMakeLists.txt ファイルと呼ばれるシンプルな設定ファイルを使用して、ソフトウェアのコンパイルプロセスを制御します。
CMakeでビルドする方法
- 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
- Use junction points on Windows
- View CMake project contents
qmakeでビルドする
qmake は、.pro という拡張子を持つプロジェクトファイルの情報に基づいて Makefile を自動生成します。
qmake でのビルド方法
キットの管理
Qt Creator グループは、クロスプラットフォーム開発を容易にするために、特定の設定をキットとしてビルドおよび実行します。各キットは、デバイス、ツールチェーン、Qt バージョン、使用するデバッガコマンドなど、1 つの環境を定義する値のセットで構成されます。
キットの管理方法
プロジェクトの実行
ローカルおよびリモートのデスクトップシステムだけでなく、コンピュータに接続した組み込みデバイスやモバイルデバイス上でもアプリケーションを実行できます。
アプリケーションの実行方法
- Configure projects for running
- Run Python applications
- Run in Qt Application Manager
- Run on QNX devices
- Run on remote Linux devices
- Run on the desktop
- Set the default build and run directories
- Specify Qt Quick UI Prototype run settings
- Specify a custom executable to run
- Use MCP client
- View application output
設定するQt Creator
基本的なQt Creator 機能とプリインストールされている拡張機能およびプラグインを使用します。より多くの拡張機能とプラグインをインストールし、外部ツールを使用するように設定します。
設定方法Qt Creator
- Activate extensions
- Collect usage statistics
- Configure the locator
- Contact Qt
- Enable and disable plugins
- Inspect internal logs
- Install extensions
- Install plugins
- Manage extensions
- Manage sessions
- Open a terminal
- Record screens
- Reset Qt Creator settings
- Run Qt Creator from the command line
- Set up screen recording
- Set up version control systems
- Turn on crash reports
- Use Qt Linguist
- Use common VCS functions
- Use external text editors
- Use external tools
プロジェクトの作成
プリセット・ウィザードや独自のウィザードを使用して、アプリケーションやライブラリを開発するためのプロジェクトを作成します。その後、ターゲット・プラットフォーム上でアプリケーションをビルドして実行するためのプロジェクトを設定します。
プロジェクトの作成方法
- Add libraries to qmake projects
- Add subprojects to projects
- Add wizards
- Convert UI projects to applications
- Create Nimble projects
- Create Qt Interface Framework projects
- Create Qt Quick Applications
- Create Qt Quick UI Prototypes
- Create VCS repositories for new projects
- Develop Qt for Python applications
- Import an existing project
- Select the build system
- Use project wizards
ファイルの追加
プロジェクトにファイルを追加する
プロジェクトにファイルを追加する方法
プロジェクトの構成
インストールプログラムやプロジェクトウィザードが作成するデフォルトの設定を変更し、特定のプロジェクトのグローバル環境設定を上書きします。
プロジェクトの設定方法
- Activate kits for a project
- Apply filters before scanning for tests
- Configure C++ code model
- Configure language servers for projects
- Configure projects for building
- Configure projects for running
- Edit environment settings
- Enable debugging
- 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
- Specify the environment for projects
- Use Qt Creator variables
デバッグ
デバッガを使用して、実行中のアプリケーションの状態を検査します。
アプリケーションのデバッグ方法
- 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
- Use MCP client
デザインUI
Design モードで統合ビジュアルエディタを使用して、Qt Quick またはQt Widgetsで UI をデザインします。
Qt Quick UIのデザイン
Qt Creator は、統合されたQt Quick Designer の UI フォーム (.ui.qml) ファイルをDesign モードで自動的に開きます。
Qt Quick UI をデザインする方法
- Add assets
- Annotate designs
- Convert UI projects to applications
- Create Qt Quick Applications
- Create Qt Quick UI Prototypes
- Design 2D UIs
- Load placeholder data
- Navigate component files
- Open UI files in Qt Design Studio
- Preview Qt Quick UIs on devices
- Preview a QML file on desktop
- Run QML files
- Specify Qt Quick UI Prototype run settings
- Use custom fonts
- Use workspaces
UIコンポーネントの使用
Qt QML モジュールをインポートして、その QML タイプのインスタンスをアプリケーションで使用する。
UIコンポーネントの使い方
- Add bindings between properties
- Add custom properties
- Add interaction to UIs
- Add text to UIs
- Change properties
- Connect components to signals
- Create buttons
- Create component instances
- Create custom components
- Create scalable buttons and borders
- Create shapes
- Import modules
- Insert UI controls
- Make layouts scalable
- Pick colors
- Pick gradients
- Set advanced component properties
- Set basic component properties
- Use images in UIs
- Use lists and other data models
- Use preset components
アニメーションを追加する
さまざまな目的に適したアニメーションのテクニックから選ぶ
UIコンポーネントのアニメーション方法
州との取り組み
ウィジェットベースのUI設計
Qt Creator は、統合されたQt Widgets Designer のDesign モードで、すべての.ui ファイルを自動的に開きます。
ウィジェットベースのUIのデザイン方法
デバイス向け開発
ターゲットとする組み込みプラットフォームまたはモバイルプラットフォーム用のアプリケーションを構築するためのツールチェインをコンピュータにインストールし、Qt Online Installer を使用してプラットフォーム用に構築された Qt ライブラリをインストールします。次に、ツールチェーンとデバイスのアーキテクチャに対応した Qt バージョンを含むキットを追加します。可能であれば、Qt Online Installer が適切なキットを作成してくれます。デバイスをコンピュータに接続して、デバイス上でアプリケーションを実行、デバッグ、分析します。
アンドロイド
Qt for Androidと Android ツールをインストールし、Android デバイスをコンピュータに接続します。
Android 用の開発方法
- Add external libraries to Android packages
- Create Android packages
- Create an Android Virtual Device (AVD)
- Debug on Android devices
- Deploy applications to Android
- Edit Android manifest files
- Manage AVDs
- Manage Android NDK packages
- Manage Android SDK packages
- Set up Android development environment
- Sign Android packages
- Specify Android run settings
Bare Metal
GDB またはハードウェア・デバッガを使用して、リモート Linux デバイス・プラグインでサポートされていない小型 Linux デバイス上でアプリケーションを実行し、デバッグします。
ベアメタルデバイス向けの開発方法
Boot to Qt
デバイス上でのアプリケーションの実行、デバッグ、解析 Boot to Qtデバイス上でアプリケーションを実行し、デバッグし、分析する。
Boot to Qt デバイス向けの開発方法
ドッカー
Dockerイメージから Dockerデバイスを作成し、アプリケーションのビルド、実行、デバッグに使用します。
Dockerデバイスの開発方法
iOS
Qt for iOSとXcodeをインストールし、iOSデバイスをコンピュータに接続します。
iOSデバイスの開発方法
MCU
インストール Qt for MCUsマイコンをインストールし、コンピュータに接続します。
QNX Neutrino
Qt for QNX をインストールし、QNX Neutrino デバイスをコンピュータに接続します。
QNX Neutrino デバイス用の開発方法
リモートLinux
汎用の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
- Deploy applications to remote Linux devices
- Generate SSH keys
- Manage device processes
- Run on remote Linux devices
- Specify remote Linux run settings
ブイエックスワークス
VxWorks用のQtをビルドし、VxWorksビルド&ランキットを作成します。
VxWorks 用アプリケーションのビルド方法
WebAssembly
Qt for WebAssembly をインストールして、Web 用のアプリケーションをビルドし、Web ブラウザで実行します。
Web 用アプリケーションのビルド方法
Windowsデスクトップ
Windows App SDKのコンポーネントとツールを使用してアプリケーションを開発します。
Windowsデスクトップ向けの開発方法
コードの編集
コードエディターには、セマンティックハイライト、コード構文のチェック、コード補完、クイックフィックスなど、C++やQMLのコード編集に便利な機能があります。これらの機能の一部はPythonなどの他のプログラミング言語にも対応しており、IDEにコードに関する情報を提供する言語サーバーが利用できます。
コードの編集方法
- Add to-do keywords
- 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
- Preview images
- 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
エディタを設定する
フォント、色、ハイライト、インデントを変更することで、特定のニーズに合わせてコードエディタとテキストエディタを設定します。
エディタの設定方法
言語サーバーの管理
Qt Creator がデフォルトで追加する言語サーバーを設定したり、追加したりします。
言語サーバーの管理方法
検索
インクリメンタルサーチとアドバンスサーチを使って、現在開いているプロジェクトやファイルシステム上のファイルを検索したり、ロケーターを使ってプロジェクト、ファイル、クラス、関数、ドキュメント、ファイルシステムをブラウズすることができます。
検索方法
状態図の編集
ファイルウィザードを使用して、定型コードを含むステートチャート XML (SCXML) ファイルを作成し、SCXML エディタで編集します。
ステート・チャートの編集方法
UMLスタイルモデルの編集
UML(Universal Modeling Language)スタイルのモデルを作成し、構造化ダイアグラムや振る舞いダイアグラムを使用して、システムにさまざまなビューを提供します。
モデルとダイアグラムの編集方法
ドキュメントを読む
Qt Creator には、インストールした Qt バージョンのリファレンス・ドキュメントが統合されています。他のソースからのドキュメントを追加することもできます。
ヘルプの入手方法
テスト
コードベースのテストを作成し、実行し、システムベースのテストを構築します。コードベースのテストは、基礎となるコードモデルや特殊なパーサーと強く結びついた、特定のテストフレームワークのための特別な処理を提供します。ビルドシステムベースのテストは、どのテストフレームワークからも独立しています。基礎となるビルドシステムから直接情報を取得し、それを使用するか、あるいはビルドシステムを使用して、それぞれのテストを実行します。
アプリケーションのテスト方法
- 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
- View Squish output
- View test results
Gitを使う
Gitは高速な分散型バージョン管理システムで、Windows、Linux、macOSで利用できます。Gitを使うプロジェクトでは、Gerritコード・レビュー・ツールを使うことができます。
Gitの使い方
- Apply actions to commits
- Commit your first change
- Create VCS repositories for new projects
- Create and apply patches
- Git Tools
- Initialize Git repositories
- Interactive rebase
- Review code with Gerrit
- Set up version control systems
- Show instant blame
- Stage changes
- Use Git for Windows
- Use Git with Subversion
- Use common VCS functions
- git am
- git blame
- git branch
- git clean
- git commit
- git diff
- git fetch
- git log
- git merge
- git pull
- git push
- git reflog
- git reset
- git stash
- git status
現在のファイル
カレントファイルの変更処理方法
現在のプロジェクト
現在のプロジェクトの変更にどう対処するか
ローカルリポジトリ
ローカル・リポジトリの管理方法
コミット
コミットの扱い方
リモートリポジトリ
リモートリポジトリの管理方法
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.