ステートチャートの作成

Qt Creator を使用すると、ステートマシンを組み込んだアプリケーションを作成できます。ファイルウィザードにより、SCXML エディタで編集可能な定型コードを含むState Chart XML (SCXML)ファイルが生成されます。 Qt SCXML モジュール内のクラスを使用して、これらのファイルから作成された Qt State Machine を Qt アプリケーションに組み込むことができます。

SCXMLエディタ

ステートチャートを作成するには:

  1. File 」>「New File 」>「Files and Classes 」>「Modeling 」>「State Chart 」>「Choose 」の順に選択し、空の状態図を作成して SCXML エディタで開きます。
  2. Common States ビュー (1) からステートエディタ (2) にステートをドラッグします。
  3. 子状態を初期状態にドラッグして複合状態を作成するか、ツールボタン (3) を使用して、選択した状態とその遷移先状態間の遷移を作成します。
  4. エディタまたは「Structure 」ビュー (5) で状態を選択し、「Attributes 」ビュー (6) でその属性を編集します。
  5. 遷移線 (4) を選択して、エッジポイントを追加します。
  6. たとえば、イベントを発生させたり送信したりするには、コンテキストメニューのコマンドを使用して、状態の「<onentry> 」および「<onexit> 」要素、または遷移に実行可能なコンテンツを追加します。

SCXML ステートチャートの編集も参照してください

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.