QScxmlError Class
QScxmlError 类描述了Qt SCXML 状态机在解析 SCXML 文件时返回的错误。更多内容...
| 标题: | #include <QScxmlError> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Scxml) target_link_libraries(mytarget PRIVATE Qt6::Scxml) |
| qmake: | QT += scxml |
属性
|
公共函数
| QScxmlError() | |
| QScxmlError(const QString &fileName, int line, int column, const QString &description) | |
| QScxmlError(const QScxmlError &other) | |
| ~QScxmlError() | |
| int | column() const |
| QString | description() const |
| QString | fileName() const |
| bool | isValid() const |
| int | line() const |
| QString | toString() const |
| QScxmlError & | operator=(const QScxmlError &other) |
另请参阅 QScxmlStateMachine 和QScxmlCompiler 。
属性文档
[read-only] column : const int
该属性保存了发生 SCXML 错误的列号。
访问函数:
| int | column() const |
[read-only] description : const QString
该属性包含对 SCXML 错误的描述。
访问函数:
| QString | description() const |
[read-only] fileName : const QString
该属性存储了发生 SCXML 错误的文件的名称。
访问函数:
| QString | fileName() const |
[read-only] line : const int
该属性保存了发生 SCXML 错误的行号。
访问函数:
| int | line() const |
[read-only] valid : const bool
该属性用于指示 SCXML 错误是否有效。
访问函数:
| bool | isValid() const |
成员函数文档
QScxmlError::QScxmlError()
创建一个新的无效 SCXML 错误。
QScxmlError::QScxmlError(const QString &fileName, int line, int column, const QString &description)
创建一个新的有效 SCXML 错误,其中包含错误消息“description ”,以及发生错误的fileName 、line 和column 。
QScxmlError::QScxmlError(const QScxmlError &other)
创建other 的副本。
[noexcept] QScxmlError::~QScxmlError()
清除 SCXML 错误。
int QScxmlError::column() const
返回发生错误的列。
注意: 这是 property column 的getter 函数。
QString QScxmlError::description() const
返回错误消息。
注意: 用于获取属性 description的获取器 函数。
QString QScxmlError::fileName() const
返回发生错误的文件名称。
注意: 这是 fileName 属性的获取器 函数。
bool QScxmlError::isValid() const
如果错误有效,则返回 `true `;否则返回 `false `。无效的错误只能通过调用默认构造函数或赋值一个无效的错误来创建。
注意: valid 属性的获取器 函数。
int QScxmlError::line() const
返回发生错误的行号。
注意: 这是 line 属性的获取器 函数。
QString QScxmlError::toString() const
此便捷方法将错误转换为字符串。返回的错误消息格式为:“文件名:行号:列号: 错误: 描述”
QScxmlError &QScxmlError::operator=(const QScxmlError &other)
将other 分配给此SCXML错误,并返回对此SCXML错误的引用。
© 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.