Qt Quick 例 - アクセシビリティ
この例では、アクセシビリティに対応したボタンの実装方法を示しています。
アクセシビリティでは、アクセシビリティシステム向けのメタデータが追加されたQML型について説明しています。詳細については、「アクセシビリティ」のページをご覧ください。
例の動作確認
以下の手順で例を実行できます:
- Qt Creator
Welcome モードを開き、Examples からこの例を選択してください。詳細については、Qt Creator の「チュートリアル:ビルドと実行」を参照してください。
- Qt Extension for Visual Studio Code
Command Palette から `Qt: Open Qt examples ` コマンドを実行し、リストからサンプルを選択します。詳細については、Qt Extension for Visual Studio Code の「チュートリアル:ビルドと実行」を参照してください。
アクセシビリティに対応したボタンの実装
ボタンは、アクセシビリティシステムに対して自身とその機能を識別します:
Accessible.name: text
Accessible.description: "This button does " + text
Accessible.role: Accessible.Button
Accessible.onPressAction: {
button.clicked()
}同様に、サンプル内の `Text ` タイプも自身を識別します:
Accessible.role: Accessible.StaticText
Accessible.name: text© 2026 The Qt Company Ltd. 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.