diff options
author | Jarek Kobus <jaroslaw.kobus@theqtcompany.com> | 2016-05-31 16:21:29 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2016-06-07 08:43:43 +0000 |
commit | 4a0d14bfcc49edc60127e0833f6cc8d4edad9027 (patch) | |
tree | 250b9730d25a9c01a4563ad25e18445f6e11e59d /src/scxml/qscxmlqstates.h | |
parent | 2906a351df804c0e8d5e4377b9ecd48d293ddf41 (diff) |
Implement srcexpr in <invoke>
Change-Id: I572342eb4952a6a0777a7503d374da6536ba052d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/scxml/qscxmlqstates.h')
-rw-r--r-- | src/scxml/qscxmlqstates.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/scxml/qscxmlqstates.h b/src/scxml/qscxmlqstates.h index 7280a0f..7014861 100644 --- a/src/scxml/qscxmlqstates.h +++ b/src/scxml/qscxmlqstates.h @@ -55,6 +55,7 @@ class QScxmlInvokeScxmlFactory: public QScxmlInvokableScxmlServiceFactory { public: QScxmlInvokeScxmlFactory(QScxmlExecutableContent::StringId invokeLocation, + QScxmlExecutableContent::EvaluatorId srcexpr, QScxmlExecutableContent::StringId id, QScxmlExecutableContent::StringId idPrefix, QScxmlExecutableContent::StringId idlocation, @@ -62,12 +63,27 @@ public: bool doAutoforward, const QVector<Param> ¶ms, QScxmlExecutableContent::ContainerId finalize) - : QScxmlInvokableScxmlServiceFactory(invokeLocation, id, idPrefix, idlocation, namelist, - doAutoforward, params, finalize) + : QScxmlInvokableScxmlServiceFactory(invokeLocation, + srcexpr, + id, + idPrefix, + idlocation, + namelist, + doAutoforward, + params, + finalize) {} QScxmlInvokableService *invoke(QScxmlStateMachine *parent) Q_DECL_OVERRIDE { + bool ok = true; + auto srcexpr = calculateSrcexpr(parent, &ok); + if (!ok) + return Q_NULLPTR; + + if (!srcexpr.isEmpty()) + return loadAndInvokeDynamically(parent, srcexpr); + return finishInvoke(new T, parent); } }; |