From 6a9f40cb8ef0eb692aec1024002027fa25414e4b Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 18 Jun 2009 06:51:17 +0200 Subject: Work with the new activated trigger from QAbstractTransition --- src/qscxml.cpp | 24 ++++++++++-------------- src/qscxml.h | 4 +--- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/qscxml.cpp b/src/qscxml.cpp index f94a1c5..5e3aff7 100644 --- a/src/qscxml.cpp +++ b/src/qscxml.cpp @@ -513,15 +513,6 @@ QScxmlEvent::QScxmlEvent( */ -/*! -\fn QScxmlTransition::onTransition(QEvent* e) -Reimplements onTransition with even \a e, to activate the transition signal. -*/ - /*! -\fn QScxmlTransition::activated() -Emitted when the transition is activated, after exiting the old states before entering the new states. -*/ - /*! \property QScxmlTransition::eventPrefix The event prefix to be used when testing if the transition needs to be invoked. @@ -538,7 +529,12 @@ QScxmlTransition::QScxmlTransition (QState* state,QScxml* machine) : QAbstractTransition(state),scxml(machine) { } - +/*! + \reimp +*/ +void QScxmlTransition::onTransition(QEvent*) +{ +} /*! \internal */ @@ -751,10 +747,10 @@ void QScxml::beginSelectTransitions(QEvent* ev) if (ev->type() == QScxmlEvent::eventType()) { QScxmlEvent* se = (QScxmlEvent*)ev; eventObj.setProperty("name",qScriptValueFromValue(pvt->scriptEng,se->eventName())); - eventObj.setProperty("target",qScriptValueFromValue(pvt->scriptEng,QVariant::fromValue(se->metaData.target))); + eventObj.setProperty("target",QScriptValue(se->metaData.target.toString())); eventObj.setProperty("targettype",qScriptValueFromValue(pvt->scriptEng,se->metaData.targetType)); eventObj.setProperty("invokeid",qScriptValueFromValue(pvt->scriptEng,se->metaData.invokeID)); - eventObj.setProperty("origin",QScriptValue(qScriptValueFromValue(pvt->scriptEng,QVariant::fromValue(se->metaData.origin)))); + eventObj.setProperty("origin",QScriptValue(se->metaData.origin.toString())); eventObj.setProperty("originType",qScriptValueFromValue(pvt->scriptEng,se->metaData.originType)); switch (se->metaData.kind) { case QScxmlEvent::MetaData::Internal: @@ -1100,7 +1096,7 @@ struct ScExecContext QObject::connect(state,SIGNAL(exited()),exec,SLOT(exec())); break; case Transition: - QObject::connect(trans,SIGNAL(activated()),exec,SLOT(exec())); + QObject::connect(trans,SIGNAL(triggered()),exec,SLOT(exec())); break; default: delete exec; @@ -1414,7 +1410,7 @@ void QScxmlLoader::loadState ( QString anc = r.attributes().value("anchor").toString(); if (!anc.isEmpty()) { stateMachine->pvt->anchorTransitions.insert(anc,curTransition); - QObject::connect (curTransition, SIGNAL(activated()),new QScxmlAnchorRestore(stateMachine,stateMachine->pvt,anc),SLOT(restore())); + QObject::connect (curTransition, SIGNAL(triggered()),new QScxmlAnchorRestore(stateMachine,stateMachine->pvt,anc),SLOT(restore())); } inf.transition = curTransition; transitions.append(inf); diff --git a/src/qscxml.h b/src/qscxml.h index 0246f5e..09d9243 100644 --- a/src/qscxml.h +++ b/src/qscxml.h @@ -70,11 +70,9 @@ class QScxmlTransition : public QAbstractTransition QString eventPrefix () const { return ev; } void setEventPrefix (const QString & e) { ev = e; } - Q_SIGNALS: - void activated (); protected: bool eventTest(QEvent*); - void onTransition (QEvent*) { emit activated(); } + void onTransition (QEvent*); private: QScxml* scxml; QString ev,cond; -- cgit v1.2.3