Commit 77f6a432 authored by Marco Benelli's avatar Marco Benelli

SCXML editor: allow eventless transitions

According to SCXML specification (, the
'event' attribute is not mandatory in 'transition' tags.
Also, as specified in section 3.12.1, eventless transitions are handled
differently, and will be taken whenever the 'cond' attribute evaluates
to 'true'.

This patch removes the automatic assignment of 'event' property in the
tag constructors, but restore it when a new transition is done in the
editor.  In this way, the user can delete the unneeded events without
them being restored when reloading the document.

Task-number: QTCREATORBUG-18345
Change-Id: I96d6860ad3ed58ab49e83d3328e88ef984f40fa4
Reviewed-by: Ulf Hermann's avatarUlf Hermann <>
parent 33bb20ba
......@@ -230,6 +230,7 @@ bool ConnectableItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
newTag = new ScxmlTag(Transition, tag()->document());
newTag->setAttribute("type", "external");
newTag->setAttribute("event", tag()->document()->nextUniqueId("Transition"));
tag()->document()->addTag(tag(), newTag);
......@@ -168,9 +168,6 @@ void ScxmlTag::initId()
case History:
setAttribute("id", m_document->nextUniqueId("History"));
case Transition:
setAttribute("event", m_document->nextUniqueId("Transition"));
case Final:
setAttribute("id", m_document->nextUniqueId("Final"));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment