このページでは

QScxmlCompiler Class

QScxmlCompiler クラスは、SCXML ファイル用のコンパイラです。詳細...

ヘッダー: #include <QScxmlCompiler>
CMake: find_package(Qt6 REQUIRED COMPONENTS Scxml)
target_link_libraries(mytarget PRIVATE Qt6::Scxml)
qmake: QT += scxml

パブリック型

class Loader

パブリック関数

QScxmlCompiler(QXmlStreamReader *reader)
~QScxmlCompiler()
QScxmlStateMachine *compile()
QList<QScxmlError> errors() const
QString fileName() const
QScxmlCompiler::Loader *loader() const
void setFileName(const QString &fileName)
void setLoader(QScxmlCompiler::Loader *newLoader)

詳細な説明

SCXMLファイルを解析し、正常に解析された SCXML ファイルに対してステートマシンを動的にインスタンス化します。解析に失敗した場合、新しいステートマシンは起動できません。すべてのエラーは `QScxmlStateMachine::parseErrors()` によって返されます。

SCXML ファイルを読み込むには、QScxmlStateMachine::fromFile またはQScxmlStateMachine::fromData を使用する必要があります。QScxmlCompiler を直接使用するのは、コンパイラがカスタムQScxmlCompiler::Loader を使用する必要がある場合に限られます。

メンバ関数のドキュメント

QScxmlCompiler::QScxmlCompiler(QXmlStreamReader *reader)

指定されたreader 用の新しいSCXMLコンパイラを作成します。

[noexcept] QScxmlCompiler::~QScxmlCompiler()

SCXML コンパイラを破棄します。

QScxmlStateMachine *QScxmlCompiler::compile()

SCXML ファイルを解析し、それに基づいて新しいステートマシンを作成します。

解析が成功した場合、返されたステートマシンを初期化して起動することができます。解析に失敗した場合は、QScxmlStateMachine::parseErrors() を使用してエラーの一覧を取得できます。

QList<QScxmlError> QScxmlCompiler::errors() const

解析エラーのリストを返します。

QString QScxmlCompiler::fileName() const

現在の入力に関連付けられているファイル名を返します。

setFileName()も参照してください 。

QScxmlCompiler::Loader *QScxmlCompiler::loader() const

SCXML コンパイラで URI の解決および読み込みに現在使用されているローダーを返します。

setLoader()も参照してください 。

void QScxmlCompiler::setFileName(const QString &fileName)

現在の入力のファイル名を「fileName 」に設定します。

このファイル名は、エラー報告や相対パス URI の解決に使用されます。

fileName()も参照してください 。

void QScxmlCompiler::setLoader(QScxmlCompiler::Loader *newLoader)

SCXMLコンパイラによるURIの解決および読み込みに使用するnewLoader を設定します。

loader()も参照してください 。

© 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.