summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Rosenthal <nrosenth@nokia.com>2009-06-18 06:51:17 +0200
committerNoam Rosenthal <nrosenth@nokia.com>2009-06-18 06:51:17 +0200
commit6a9f40cb8ef0eb692aec1024002027fa25414e4b (patch)
treed4ece5cd5ba3b2acc817291dbfe8e81a9fbe616d
parent65e5705f1955b2a780668d9766abc64973d6ee12 (diff)
Work with the new activated trigger from QAbstractTransition
-rw-r--r--src/qscxml.cpp24
-rw-r--r--src/qscxml.h4
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<QString>(pvt->scriptEng,se->eventName()));
- eventObj.setProperty("target",qScriptValueFromValue(pvt->scriptEng,QVariant::fromValue<QUrl>(se->metaData.target)));
+ eventObj.setProperty("target",QScriptValue(se->metaData.target.toString()));
eventObj.setProperty("targettype",qScriptValueFromValue<QString>(pvt->scriptEng,se->metaData.targetType));
eventObj.setProperty("invokeid",qScriptValueFromValue<QString>(pvt->scriptEng,se->metaData.invokeID));
- eventObj.setProperty("origin",QScriptValue(qScriptValueFromValue(pvt->scriptEng,QVariant::fromValue<QUrl>(se->metaData.origin))));
+ eventObj.setProperty("origin",QScriptValue(se->metaData.origin.toString()));
eventObj.setProperty("originType",qScriptValueFromValue<QString>(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;