summaryrefslogtreecommitdiffstats
path: root/src/imports/scxmlstatemachine/statemachineloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/scxmlstatemachine/statemachineloader.cpp')
-rw-r--r--src/imports/scxmlstatemachine/statemachineloader.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/imports/scxmlstatemachine/statemachineloader.cpp b/src/imports/scxmlstatemachine/statemachineloader.cpp
index 247d989..946988f 100644
--- a/src/imports/scxmlstatemachine/statemachineloader.cpp
+++ b/src/imports/scxmlstatemachine/statemachineloader.cpp
@@ -56,18 +56,6 @@
\since QtScxml 5.7
*/
-/*!
- \qmlsignal StateMachineLoader::sourceChanged()
- This signal is emitted when the user changes the source URL for the SCXML document.
-*/
-
-/*!
- \qmlsignal StateMachineLoader::stateMachineChanged()
-
- This signal is emitted when the stateMachine property changes. That is, when
- a new state machine is loaded or when the old one becomes invalid.
-*/
-
QScxmlStateMachineLoader::QScxmlStateMachineLoader(QObject *parent)
: QObject(parent)
, m_dataModel(Q_NULLPTR)
@@ -77,7 +65,7 @@ QScxmlStateMachineLoader::QScxmlStateMachineLoader(QObject *parent)
}
/*!
- \qmlproperty QObject StateMachineLoader::stateMachine
+ \qmlproperty ScxmlStateMachine StateMachineLoader::stateMachine
The state machine instance.
*/
@@ -87,9 +75,10 @@ QT_PREPEND_NAMESPACE(QScxmlStateMachine) *QScxmlStateMachineLoader::stateMachine
}
/*!
- \qmlproperty string StateMachineLoader::source
+ \qmlproperty url StateMachineLoader::source
- The url of the SCXML document to load. Only synchronously accessible URLs are supported.
+ The URL of the SCXML document to load. Only synchronously accessible URLs
+ are supported.
*/
QUrl QScxmlStateMachineLoader::source()
{
@@ -156,21 +145,21 @@ void QScxmlStateMachineLoader::setDataModel(QScxmlDataModel *dataModel)
bool QScxmlStateMachineLoader::parse(const QUrl &source)
{
if (!QQmlFile::isSynchronous(source)) {
- qmlInfo(this) << QStringLiteral("ERROR: cannot open '%1' for reading: only synchronous access is supported.")
+ qmlWarning(this) << QStringLiteral("Cannot open '%1' for reading: only synchronous access is supported.")
.arg(source.url());
return false;
}
QQmlFile scxmlFile(QQmlEngine::contextForObject(this)->engine(), source);
if (scxmlFile.isError()) {
// the synchronous case can only fail when the file is not found (or not readable).
- qmlInfo(this) << QStringLiteral("ERROR: cannot open '%1' for reading.").arg(source.url());
+ qmlWarning(this) << QStringLiteral("Cannot open '%1' for reading.").arg(source.url());
return false;
}
QByteArray data(scxmlFile.dataByteArray());
QBuffer buf(&data);
if (!buf.open(QIODevice::ReadOnly)) {
- qmlInfo(this) << QStringLiteral("ERROR: cannot open input buffer for reading");
+ qmlWarning(this) << QStringLiteral("Cannot open input buffer for reading");
return false;
}
@@ -189,12 +178,12 @@ bool QScxmlStateMachineLoader::parse(const QUrl &source)
QMetaObject::invokeMethod(m_stateMachine, "start", Qt::QueuedConnection);
return true;
} else {
- qmlInfo(this) << QStringLiteral("Something went wrong while parsing '%1':")
+ qmlWarning(this) << QStringLiteral("Something went wrong while parsing '%1':")
.arg(source.url())
<< endl;
const auto errors = m_stateMachine->parseErrors();
for (const QScxmlError &error : errors) {
- qmlInfo(this) << error.toString();
+ qmlWarning(this) << error.toString();
}
emit stateMachineChanged();