方法
以下のトピックでは、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 Zen Mode
- 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
- Build with GN
- 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 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つの環境を定義する一連の値で構成されています。
キットの管理方法
プロジェクトの実行
ローカルおよびリモートデスクトップシステム、ならびにコンピュータに接続した組み込みデバイスやモバイルデバイス上でアプリケーションを実行します。
アプリケーションの実行方法
設定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
UIのデザイン
「Qt Quick 」または「Qt Widgets」のいずれかを使用し、Design モードの統合ビジュアルエディタでUIを設計します。
Qt Quick のUIの設計
Qt Creator この操作を行うと、統合されたQt Quick Designerで、UIフォーム(.ui.qml )ファイルがDesign モードで自動的に開かれます。
Qt Quick UIの設計方法
- Add assets
- Add designs from Figma to Qt
- 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 内のすべての.ui ファイルが、Design モードで自動的に開かれます。
ウィジェットベースのUIの設計方法
デバイス向け開発
対象の組み込みまたはモバイルプラットフォーム向けのアプリケーションをビルドするためのツールチェーンをコンピュータにインストールし、Qt Online Installer を使用して、そのプラットフォーム向けにビルドされた Qt ライブラリをインストールします。その後、そのデバイスのアーキテクチャに対応したツールチェーンと Qt バージョンを含むキットを追加します。可能な場合は、Qt Online Installer が適切なキットを自動的に作成します。 デバイスをコンピュータに接続し、アプリケーションの実行、デバッグ、および分析を行います。
Android
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
リモートLinuxデバイスプラグインでサポートされていない小型のLinuxデバイス上で、GDBまたはハードウェアデバッガを使用してアプリケーションを実行およびデバッグします。
ベアメタルデバイス向けの開発方法
Boot to Qt
デバイス上でアプリケーションを実行、デバッグ、および分析する Boot to Qt デバイス上で実行、デバッグ、および分析します。
Boot to Qt デバイス向けの開発方法
Docker
Docker イメージから Docker デバイスを作成し、それを利用してアプリケーションのビルド、実行、デバッグを行います。
Dockerデバイス向けの開発方法
iOS
iOS用QtとXcodeをインストールし、iOSデバイスをコンピュータに接続します。
iOSデバイス向けの開発方法
MCU
インストール Qt for MCUsし、マイクロコントローラをコンピュータに接続します。
マイクロコントローラ向け開発の方法
QNX Neutrino
QNX用Qtをインストールし、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
VxWorks 用の Qt をビルドし、VxWorks 用のビルドおよび実行キットを作成します。
VxWorks向けアプリケーションのビルド方法
WebAssembly
Web向けアプリケーションを構築し、Webブラウザで実行するには、Qt for WebAssemblyをインストールしてください。
Web向けアプリケーションのビルド方法
Windows デスクトップ
Windows App SDKのコンポーネントとツールを使用してアプリケーションを開発します。
Windows デスクトップ向けの開発方法
コードを編集
コードエディタには、セマンティックハイライト、構文チェック、コード補完、クイックフィックスなど、C++ や QML コードの編集に役立つ機能が用意されています。これらの機能の一部は、Python などの他のプログラミング言語でも利用可能です。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
- 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
AIを活用する
コードベースを理解し、ファイルの編集、コマンドの実行、ビルドの開始など、ユーザーに代わって操作を実行するAIエージェントと対話できます。
AIの使い方
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
- Manage remote repositories
- Review code with Gerrit
- Set up Git
- Set up version control systems
- Show instant blame
- Stage changes
- Use Git for Windows
- Use Git with Subversion
- Use common VCS functions
- git amend
- 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.